- #1
ZakAttk1
- 7
- 0
I want to infinitely print a saying to the console but I am not allowed to used iostream.
I am using the function putc. I understand I need to use an infinite loop. So far I have:
int main()
{
char *word;
word = &SAYING[0];
while(true)
{
putc(*word, stdout);
word ++;
putc(*word, stdout);
}
return 0;
However, it only prints the first 2 characters. I need to somehow write some code that automatically prints the saying without having to repeat:
word ++;
putc(*word, stdout);
any advice on how to get started on the rest?
Thanks.
I am using the function putc. I understand I need to use an infinite loop. So far I have:
int main()
{
char *word;
word = &SAYING[0];
while(true)
{
putc(*word, stdout);
word ++;
putc(*word, stdout);
}
return 0;
However, it only prints the first 2 characters. I need to somehow write some code that automatically prints the saying without having to repeat:
word ++;
putc(*word, stdout);
any advice on how to get started on the rest?
Thanks.