Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
char* to string conversion
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="electrixnow, post: 2543402"] Sorry but I am a newbie and I searched for usage on std::map and found nothing. Can you give me an exact example of: std::map<int, char> bData = dataFrom( pathToB ); // open file r/w std::ifstream a( pathToA ); // open file for read std::ofstream c( pathToC ); // open file for write while( !!a ) // why 2 ! // looking for NULL or EOF { -- read one line from a // I can use inf.getline -- split the line into doc # and rev char // use strtok_s ? -- check against bData // use string or pointer ? -- if different revision char: -- update bData -- write line to c } assert( a.eof() ); // are you checking for eof again save( bData, pathToB ); // could'nt find save usage in help Sorry I am not an expert, but I am new and this task seems simple but has been frustraiting. I was hung up on cannot convert from 'char *' to 'char' I understand the flow you created and it's on the money. I wish I had some good examples to study. I have been looking all over and have not found any good sites with lots of simple VC++ examples. Please help. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
char* to string conversion
Top