ä»å¹´ã®2æã«ãã«ã¼ã«ãªã£ãbokkoã§ããã©ããåã®ä½¿ã£ã¦ãããã©ã³ããã»ãã®äººã«ã¯è¦ã¥ããããããããã®ãã©ã³ãã¯ãããwãã¨è¨ãããããå¤ä»ãã®ãã¼ãã¼ãã使ã£ã¦ãããããããMacBookã®æå³ãªã!ãã¨ç¤¾å ã§è¨ããã¦ãããã¦ãã¾ãã ä»æ¥ã¯gdbã®ã話ã§ããgdbã¯é常ã«åºã使ããã¦ãããããã¬ã§ãç¹ã«CãC++ã®ããã°ã©ã ããããã°ããã®ã«ãã使ããã¦ãã¾ãã ãããã¬ã®ä½¿ãæ¹ ããã°ã©ã ããããã°ããéãä¾ãã°ä»¥ä¸ã®æ¹æ³ãæãããã¾ãã 1. ã½ã¼ã¹ã³ã¼ããèªã 2. ã½ã¼ã¹ã³ã¼ãã«åºåé¢æ°ãä»è¾¼ã(ä¾ãã°printf) 3. ã½ã¼ã¹ã³ã¼ããæ¸ãæãã¦å®è¡ãã¦ã¿ã ããã§ååãªå ´åãããã¾ãããããã§ãªãå ´åãããã¾ãããããã®æ¹æ³ã§ã¯ããã°ã©ã ãå®è¡ãã¦ããæä¸ã«ãã¡ãããã½ã¼ã¹ã³ã¼ãã¬ãã«ã§ã®ã¢ã¯ã·ã§ã³ãèµ·ãããã¨ãé£ããã®ã§ãä¾ãã°ãããã°ã©ã ãããæç¹ã§æ¢ãã¦å¤æ°ã®
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
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}