Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Complex code in conditionals Pin
Richard MacCutchan4-Aug-15 2:44
mveRichard MacCutchan4-Aug-15 2:44 
GeneralRe: Complex code in conditionals Pin
charlieg4-Aug-15 6:22
charlieg4-Aug-15 6:22 
AnswerRe: Complex code in conditionals Pin
Stefan_Lang11-Aug-15 2:34
Stefan_Lang11-Aug-15 2:34 
Questionstrcpy dilemma - it works half way Pin
Vaclav_3-Aug-15 15:19
Vaclav_3-Aug-15 15:19 
GeneralRe: strcpy dilemma - it works half way Pin
PIEBALDconsult3-Aug-15 16:12
mvePIEBALDconsult3-Aug-15 16:12 
AnswerRe: strcpy dilemma - it works half way Pin
Richard MacCutchan3-Aug-15 20:48
mveRichard MacCutchan3-Aug-15 20:48 
AnswerRe: strcpy dilemma - it works half way Pin
CPallini3-Aug-15 21:08
mveCPallini3-Aug-15 21:08 
GeneralRe: strcpy dilemma - it works half way Pin
Vaclav_4-Aug-15 3:49
Vaclav_4-Aug-15 3:49 
Thanks, one of these days I'll hope to learn.
I did change the initialization and it did the trick with the exception of Result.

Can you explain to me why Result needs to be declared this way?

I appreciate all you guys time and I am sorry about the poor choice of variable names I did.
Thanks.


I am enclosing my full test code, just FYI , so do not pay much attention to it.

char *Result = {"0007890"};
char Destination[] = {"456"};
char Temp[] = {" "};
char Source[] = {"123"};

#ifdef DEBUG
lcd_i2c.clear();
//lcd_i2c.print("BuildAttribute...");
lcd_i2c.setCursor(0, 0);
lcd_i2c.print("Result ");
lcd_i2c.print(Result );
//for(;;);
lcd_i2c.setCursor(0, 1);
lcd_i2c.print("Source " );
lcd_i2c.print(Source );
//strcpy(PassedAttribute, "attribute");
lcd_i2c.setCursor(0, 2);
lcd_i2c.print("Dest " );
lcd_i2c.print(Destination );
lcd_i2c.setCursor(0, 3);
//lcd_i2c.print(Attribute);
//delay(2000);
//for(;;);
//return PassedAttribute;
#endif

//Result = strncpy(Source, "TESTDestination",2 );
printf("%s %s\n", Destination, Source);
Result = strcpy(Destination, Source);
printf("%s %s\n", Destination, Source);

//for (;;);
#ifdef DEBUG
lcd_i2c.clear();
//lcd_i2c.print("BuildAttribute...");
lcd_i2c.setCursor(0, 0);
lcd_i2c.print("Result ");
lcd_i2c.print(Result );
//for(;;);
lcd_i2c.setCursor(0, 1);
lcd_i2c.print("Source " );
lcd_i2c.print(Source );
//strcpy(PassedAttribute, "attribute");
lcd_i2c.setCursor(0, 2);
lcd_i2c.print("Dest " );
lcd_i2c.print(Destination );
lcd_i2c.setCursor(0, 3);
lcd_i2c.print("Temp ");
lcd_i2c.print(Temp);
//delay(2000);
for (;;);
//return PassedAttribute;
#endif
for(;;);
GeneralRe: strcpy dilemma - it works half way Pin
CPallini4-Aug-15 6:54
mveCPallini4-Aug-15 6:54 
GeneralSOLVED Re: strcpy dilemma - it works half way Pin
Vaclav_4-Aug-15 7:41
Vaclav_4-Aug-15 7:41 
AnswerRe: strcpy dilemma - it works half way Pin
Arthur V. Ratz13-Aug-15 18:54
professionalArthur V. Ratz13-Aug-15 18:54 
QuestionMsbuild for VC++ project having path errors Pin
code_az3-Aug-15 12:54
code_az3-Aug-15 12:54 
Questionruntime error due to corruption of heap Pin
Member 93502372-Aug-15 22:22
Member 93502372-Aug-15 22:22 
AnswerRe: runtime error due to corruption of heap Pin
Member 93502372-Aug-15 22:33
Member 93502372-Aug-15 22:33 
SuggestionRe: runtime error due to corruption of heap Pin
David Crow3-Aug-15 2:12
David Crow3-Aug-15 2:12 
AnswerRe: runtime error due to corruption of heap Pin
Daniel Pfeffer3-Aug-15 0:52
professionalDaniel Pfeffer3-Aug-15 0:52 
AnswerRe: runtime error due to corruption of heap Pin
Jochen Arndt3-Aug-15 2:13
professionalJochen Arndt3-Aug-15 2:13 
QuestionConvert to ASCII ? Pin
Vaclav_1-Aug-15 3:52
Vaclav_1-Aug-15 3:52 
AnswerRe: Convert to ASCII ? Pin
CPallini1-Aug-15 4:15
mveCPallini1-Aug-15 4:15 
AnswerRe: Convert to ASCII ? Pin
Richard MacCutchan1-Aug-15 4:33
mveRichard MacCutchan1-Aug-15 4:33 
GeneralRe: Convert to ASCII ? Pin
Vaclav_1-Aug-15 9:40
Vaclav_1-Aug-15 9:40 
GeneralRe: Convert to ASCII ? Pin
Richard MacCutchan1-Aug-15 21:00
mveRichard MacCutchan1-Aug-15 21:00 
GeneralRe: Convert to ASCII ? Pin
CPallini2-Aug-15 6:56
mveCPallini2-Aug-15 6:56 
QuestionEfficient way of converting an 8bit array of grayscale pixel data into 24bpp bitmap for GDI+? Pin
Kiran Satish31-Jul-15 8:39
Kiran Satish31-Jul-15 8:39 
QuestionRe: Efficient way of converting an 8bit array of grayscale pixel data into 24bpp bitmap for GDI+? Pin
CPallini31-Jul-15 21:40
mveCPallini31-Jul-15 21:40 

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.