This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf

Hello!

I am trying to use sprintf, but get no result (C51, version 5.20).

char xdata command [80], i=100;
strcpy (command, "Hello!"); // now command contains "Hello!"
sprintf (command, "Test %d", i); // command has not changed
Why would sprintf not work?
Thank you for any help!
Holger

Parents
  • Yeah,

    Back in the old days,

    while (1);

    actually generated code with many compilers while

    for(;;);

    did not.

    I mainly use while(1) because it's immediately obvious what it does.

    I interview about 2 people a week who claim to be C programmers who cannot tell me what for(;;) does!!! So, I try not to give an answer that generates even MORE questions. :-)

    Jon

Reply
  • Yeah,

    Back in the old days,

    while (1);

    actually generated code with many compilers while

    for(;;);

    did not.

    I mainly use while(1) because it's immediately obvious what it does.

    I interview about 2 people a week who claim to be C programmers who cannot tell me what for(;;) does!!! So, I try not to give an answer that generates even MORE questions. :-)

    Jon

Children
No data