[問題] 關於輸入資料到指標陣列內
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
dev c++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
無
問題(Question):
執行程式時會發生錯誤,似乎是segment error
不過還是不太了解種error這是啥意思
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
compile沒錯 run的時候打了兩行字就程式錯誤
程式碼(Code):(請善用置底文網頁, 記得排版)
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *a[5];
int i ;
for (i=0 ; i<5 ; i++ )
{
scanf("%s" , a[i]) ;
}
for( i=0 ; i<5 ; i++ )
{
printf( "%s \n" , a[i] );
}
system ("pause");
return 0;
}
補充說明(Supplement):
跪求各位前輩們費心指點,感既不盡
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.138.176.112
→
05/30 15:17, , 1F
05/30 15:17, 1F
→
05/30 18:03, , 2F
05/30 18:03, 2F
→
05/30 18:10, , 3F
05/30 18:10, 3F
→
05/31 16:31, , 4F
05/31 16:31, 4F
→
05/31 16:32, , 5F
05/31 16:32, 5F