c言語のインクリメントの動作確認
#include <stdio.h> int main() { int i = 10; i = ++i + ++i; printf("%d\n", i); // 24を表示する return i; }
グループ名を変更する
groupmod -n 変更後のグループ名 変更前のグループ名
screenで設定ファイルを指定する
デフォルトの$HOME/.screenrcではなく、別の設定ファイルを使用する場合、以下のようにする。
screen -c 設定ファイル名
特定の拡張子をもったファイルのzip圧縮
「*.c」「*.h」の拡張子のファイルを階層をたどって圧縮する場合。
zip -r hoge.zip . -i *.c *.h
構造体の代入
#include <stdio.h> typedef struct { int hoge; char hogeStr[100]; }sHOGE; int main() { sHOGE hoge; sHOGE hogeCopy; sHOGE *pHoge; sHOGE hogeReal; hoge.hoge = 100; snprintf( hoge.hogeStr, sizeof(hoge.hogeStr), "aiueo" ); // 代入 hogeCopy = hoge; printf( "%d, %s\n", hoge.hoge, hoge.hogeStr ); // 100, aiueo pHoge = &hogeReal; // これはいけるのか? *pHoge = hoge; // いける printf( "%d, %s\n", pHoge->hoge, pHoge->hogeStr ); // 100, aiueo return 0; }