C/C++- 請問語法問題

匿 匿名 645 次瀏覽 0 個回答

我使用Keil C編譯器, 請教一個語法問題

char *name = "stream_server";

這樣子會讓string寫到不明位置造成危險嗎?
但我宣告為 char name[];
compiler卻又告訴我 incomplete type is not allowed

我一定要宣告為 char name[10];
才能夠成功 0 Error.

但由於我的所帶入的字串並非都是等長, 不知道該怎樣做才好?
thanks!

--

我要回答

0 個回答

還沒有人回答,你知道答案嗎?

我要回答

登入會員後即可回答問題。

免費註冊