2008å¹´04æ04æ¥03:00 ã«ãã´ãªTips c - *sã¨s[]ã®éã ãããçµæ§trickyã The C Programmming Lanugage K&R ã *s ãã¨ã s[] ãã®éã - ITæ¦è¨ ã³ã¡ã³ãæ¬ã«ãããK&Rã®5.3ãèªãã°ãããããã¨ããã¨å¤åããããªããããã©ããã P. 100 char s[]; and char *s; are equivalent; ãªãã¦æ¸ãã¦ããããä½è¨ããããªããªãã¨æãã ãªã®ã ãã©ããã£ããç°¡åãªè¦ãæ¹ãããã çã㯠sã®å¤ãå¤æ´ã§ããã è¦ããã« char *s = "pointer"; printf("%s\n", ++s); ã¯OKã ãã©ã char s[] = "array"; printf("%s\n", ++s); ã¯NGã¨ãããã¨ãGCCãªã error: wrong type argument to
{{#tags}}- {{label}}
{{/tags}}