Click here to Skip to main content
16,006,006 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionappend a character to a char* Pin
moonraker92828-Jul-07 18:56
moonraker92828-Jul-07 18:56 
AnswerRe: append a character to a char* Pin
cp987628-Jul-07 22:18
cp987628-Jul-07 22:18 
GeneralRe: append a character to a char* Pin
moonraker92828-Jul-07 22:26
moonraker92828-Jul-07 22:26 
GeneralRe: append a character to a char* Pin
cp987628-Jul-07 22:49
cp987628-Jul-07 22:49 
GeneralRe: append a character to a char* Pin
moonraker92828-Jul-07 22:59
moonraker92828-Jul-07 22:59 
GeneralRe: append a character to a char* Pin
cp987628-Jul-07 23:45
cp987628-Jul-07 23:45 
GeneralRe: append a character to a char* Pin
moonraker92829-Jul-07 10:08
moonraker92829-Jul-07 10:08 
GeneralRe: append a character to a char* Pin
cp987629-Jul-07 12:59
cp987629-Jul-07 12:59 
moonraker928 wrote:
char* results_text[7];


allocates an array of 7 character pointers. If you are trying to allocate a buffer for characters:

<br />
double d = 3.14;<br />
char text[128];<br />
sprintf(text, "%f", d);<br />


Be careful with sprintf() that you don't overwrite the buffer - there is a safer version in VS20058 - sprintf_s(). Making the buffer only 7 characters long needs care, I've allocated 128 bytes to be safe.







Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: append a character to a char* Pin
moonraker92829-Jul-07 13:03
moonraker92829-Jul-07 13:03 
GeneralRe: append a character to a char* Pin
cp987629-Jul-07 13:36
cp987629-Jul-07 13:36 
GeneralRe: append a character to a char* Pin
User 58385229-Jul-07 18:34
User 58385229-Jul-07 18:34 
GeneralRe: append a character to a char* Pin
cp987629-Jul-07 19:08
cp987629-Jul-07 19:08 
GeneralRe: append a character to a char* Pin
David Crow30-Jul-07 4:12
David Crow30-Jul-07 4:12 
AnswerRe: append a character to a char* Pin
Mark Salsbery30-Jul-07 6:43
Mark Salsbery30-Jul-07 6:43 
GeneralRe: append a character to a char* Pin
moonraker92830-Jul-07 9:18
moonraker92830-Jul-07 9:18 
QuestionVC6.0 Compiler error. Pin
Eytukan28-Jul-07 7:01
Eytukan28-Jul-07 7:01 
AnswerRe: VC6.0 Compiler error. Pin
Mark Salsbery28-Jul-07 7:45
Mark Salsbery28-Jul-07 7:45 
GeneralRe: VC6.0 Compiler error. Pin
Eytukan28-Jul-07 7:50
Eytukan28-Jul-07 7:50 
GeneralRe: VC6.0 Compiler error. Pin
Mark Salsbery28-Jul-07 7:52
Mark Salsbery28-Jul-07 7:52 
GeneralRe: VC6.0 Compiler error. Pin
Randor 28-Jul-07 9:10
professional Randor 28-Jul-07 9:10 
GeneralRe: VC6.0 Compiler error. Pin
Paul Conrad28-Jul-07 10:32
professionalPaul Conrad28-Jul-07 10:32 
QuestionHow to rotate an icon? Pin
eli1502197928-Jul-07 5:15
eli1502197928-Jul-07 5:15 
AnswerRe: How to rotate an icon? Pin
Eytukan28-Jul-07 5:22
Eytukan28-Jul-07 5:22 
GeneralRe: How to rotate an icon? Pin
eli1502197928-Jul-07 5:28
eli1502197928-Jul-07 5:28 
GeneralRe: How to rotate an icon? Pin
Eytukan28-Jul-07 5:31
Eytukan28-Jul-07 5:31 

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.