intfuncA(void){int*ptrA =NULL; ptrA = (int*)malloc(sizeof(int));if(ptrA ==NULL) {return-1; }/* 何かしらの処理を実行 */free(ptrA);/* 何かしらの処理を実行 *//* 間違って再度ptrAをfree*/free(ptrA);return0; }
Register as a new user and use Qiita more conveniently You get articles that match your needs You can efficiently read back useful information You can use dark theme What you can do with signing up Sign upLogin Comments No comments Let's comment your feelings that are more than good ...
配列のインデックス番号が必要なときはenumerate関数を使う while 条件が成立している間繰り返す C言語と同じbreak とcontinue も同じ do-while 最初に1回無条件に実行 なし switch-case 場合分け なし辞書を使って場合分けできる del なし 変数を削除できる ライブラリ取り込み #include import...
obj->size=siz;return0;}intmain(){int*tmp=NULL;MyObject*arr[MAX];for(inti=0;i<MAX;++i){arr[i]=malloc(sizeof(MyObject));if(initMyObject(arr[i],TRUE,tmp,sizeof(tmp))==-1){fprintf(stderr,"[ERROR] initMyObject() failed\n");break;}}printf("finished\n");exit(EXIT_SUCCESS);...
x83\x46\x06\x42\x83\x46\x07\x7a\x83\x46\x08\x72\x83\x46\x09\x6c\x83\x46\x0a\x64\x48\xc7\xc0\x01\x00\x00\x00\x48\xc7\xc7\x01\x00\x00\x00\x48\xc7\xc2\x0b\x00\x00\x00\x0f\x05\x5d\xc3";memcpy(output,code,CODE_LEN);void(*o)(void)=output;o();return0;...