-2
我要讀一個字符串,與其他來連接並打印出結果 我試過這段代碼:如何掃描與空格的字符串,並打印出來ç
int main(){
char s= "StackOverflow ";
char ss[100];
fgets(ss,100,stdin);
// i know i can use strcat but i don't want it here
printf("%s%s",s,ss);
return 0;
}
的ss是「是最好的網站學習的東西!「 有些幫助?
請看編譯器的警告。 –
你真的必須使用char * s來存放一個字符串「Stackoverflow」。您正試圖在char中保存一個字符串。 – 16tons
'char s = ...' - >'const char * s = ...' – BLUEPIXY