2008-08-27から1日間の記事一覧

文字列は0(ヌル文字)で終わる

これは問題ないが #include <stdio.h> int main(void){ char str[4] = "aaa"; printf("%s", str); return 0; } これはエラーとなる #include <stdio.h> int main(void){ char str[4] = "aaaa"; printf("%s", str); return 0; } *strが指し示すのは*(str + 0)なので%sが要求する</stdio.h></stdio.h>…

Emacs上でshellを使う

M-x shell Enter

C言語の目次

学習Tips gccを使う makeを使う Emacs上でshellを使う 文字列は0(ヌル文字で終わる) ポインタ 基本 例文1 例文2 文字列へのポインタ 多次元配列へのポインタ ポインタの配列 ポインタのポインタ 関数 配列を渡す ポインタを返す関数 コマンドライン argc, ar…