Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Read binary File Pin
Freak3028-Nov-12 23:18
Freak3028-Nov-12 23:18 
GeneralRe: Read binary File Pin
002comp28-Nov-12 23:41
002comp28-Nov-12 23:41 
QuestionRe: Read binary File Pin
David Crow29-Nov-12 2:37
David Crow29-Nov-12 2:37 
Questionextracting resources from an exe for translation Pin
chronodekar28-Nov-12 21:28
chronodekar28-Nov-12 21:28 
AnswerRe: extracting resources from an exe for translation Pin
Mattias G3-Dec-12 22:24
Mattias G3-Dec-12 22:24 
Questioncompile code twice,why the two result is differrent Pin
yingkou28-Nov-12 21:10
yingkou28-Nov-12 21:10 
AnswerRe: compile code twice,why the two result is differrent Pin
Stefan_Lang28-Nov-12 22:31
Stefan_Lang28-Nov-12 22:31 
AnswerRe: compile code twice,why the two result is differrent Pin
Stephen Hewitt29-Nov-12 0:42
Stephen Hewitt29-Nov-12 0:42 
AnswerRe: compile code twice,why the two result is differrent Pin
Sajeesh Payolam30-Nov-12 18:28
Sajeesh Payolam30-Nov-12 18:28 
AnswerRe: compile code twice,why the two result is differrent Pin
Cristian Amarie3-Dec-12 8:55
Cristian Amarie3-Dec-12 8:55 
QuestionCListCtrl Pin
sarfaraznawaz28-Nov-12 21:07
sarfaraznawaz28-Nov-12 21:07 
AnswerRe: CListCtrl Pin
Jochen Arndt28-Nov-12 21:30
professionalJochen Arndt28-Nov-12 21:30 
QuestionLong pointer to character C++ Pin
pix_programmer28-Nov-12 4:41
pix_programmer28-Nov-12 4:41 
GeneralRe: Long pointer to character C++ Pin
David Crow28-Nov-12 5:19
David Crow28-Nov-12 5:19 
AnswerRe: Long pointer to character C++ Pin
Richard MacCutchan28-Nov-12 5:20
mveRichard MacCutchan28-Nov-12 5:20 
AnswerRe: Long pointer to character C++ Pin
Stefan_Lang28-Nov-12 6:07
Stefan_Lang28-Nov-12 6:07 
pix_programmer wrote:
I'm reading some string from a XML file and assigning it to a <code>const char*</code> variable.

That doesn't make sense. A pointer can only be sensibly initialized within the program, at runtime, because only then does the computer know where in memeory every object lies. Therefore it doesn't make sense to either store or restore a pointer to/from a file!

What you need to do instead is:
1. read that string from your file
2. Allocate a char array on the heap that is big enough to contain that string (including the terminating NULL character!)
3. Assign that array to your pointer
4. Store the string in that char array.

Of course, if you use std::string, that would save you some of that efort.
GeneralRe: Long pointer to character C++ Pin
David Crow28-Nov-12 7:56
David Crow28-Nov-12 7:56 
GeneralRe: Long pointer to character C++ Pin
Stefan_Lang28-Nov-12 22:03
Stefan_Lang28-Nov-12 22:03 
AnswerRe: Long pointer to character C++ Pin
CPallini28-Nov-12 7:48
mveCPallini28-Nov-12 7:48 
AnswerRe: Long pointer to character C++ Pin
Sajeesh Payolam30-Nov-12 18:35
Sajeesh Payolam30-Nov-12 18:35 
AnswerRe: Long pointer to character C++ Pin
April Fans13-Dec-12 18:06
April Fans13-Dec-12 18:06 
Questionproblem in c with linux Pin
a1_shay28-Nov-12 2:23
a1_shay28-Nov-12 2:23 
AnswerRe: problem in c with linux Pin
CPallini28-Nov-12 3:07
mveCPallini28-Nov-12 3:07 
SuggestionRe: problem in c with linux Pin
Richard MacCutchan28-Nov-12 3:11
mveRichard MacCutchan28-Nov-12 3:11 
GeneralRe: problem in c with linux Pin
a1_shay28-Nov-12 21:35
a1_shay28-Nov-12 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.