为啥会自动换行
#include <stdio.h>
void main()
{
char str[ ]= "abc", *ps=str;
while(*ps)
ps++;
for(ps--; ps-str>=0; ps--)
puts(ps);
}
为啥结果是
c
bc
abc
而不是cbcabc啊,程序中也没有\n啊
为啥会自动换行
#include <stdio.h>
void main()
{
char str[ ]= "abc", *ps=str;
while(*ps)
ps++;
for(ps--; ps-str>=0; ps--)
puts(ps);
}
为啥结果是
c
bc
abc
而不是cbcabc啊,程序中也没有\n啊
puts自带换行。不想换行就用printf("%s",ps);