I think you think that strcat does something that it doesn't. You can't just cast an int to a char * and expect it to work.
How about
:
Code:
int loop=0;
while (IsAuto())
{
printf("%d iteration\n", ++loop);
}
That is the most direct way to accomplish what you want. Alternatively, here's how to do it with strcat() properly:
Code:
int loop=0;
while (IsAuto())
{
char msg[100]; // We can't just declare this as a "char *" without first allocating memory - 100 characters is more than enough
strcat( msg, itoa(++loops) );
strcat( msg, " iteration\n");
printf("%s", msg);
}
The standard C itoa() function takes an integer and returns a C string of the printable characters.