0

Why puts cant work here

void main(){ char s[ ]= "Lol sam 66"; char *p; p=s; while(*p) puts(*p++); while(--p>=s) puts(*p);

19th May 2019, 3:09 PM
Dzondzula
Dzondzula - avatar
4 Respostas
+ 5
Use putchar instead of puts (and int main + return 0 instead of void main) and you'll be fine
19th May 2019, 4:06 PM
Anna
Anna - avatar
+ 4
Yes, isn't that what you're doing? Iterating over the string char by char?
19th May 2019, 4:18 PM
Anna
Anna - avatar
+ 2
Daa tnx👌🏽
19th May 2019, 4:20 PM
Dzondzula
Dzondzula - avatar
+ 1
Anna Isnt a putchar only for 1 character?
19th May 2019, 4:16 PM
Dzondzula
Dzondzula - avatar