-4
#include<stdio.h>
#include<string.h>
int main()
{
char from[100]="we are the people",to[100];
int i,count=0;
puts(from);
//copying string
for(i=0;from[i];i++)
{
to[i]=from[i];
}
to[i]='\0';
//printing the new string
puts[to];
}
爲什麼編譯器顯示數組下標不是本聲明的integar?
puts [to];
但爲什麼這不顯示錯誤?
puts [from];
這些都是錯誤。你應該寫'puts(to);' – 2014-11-03 02:41:59
thanx我沒有注意到 – 2014-11-03 02:57:33