記事へのコメント149件
- 注目コメント
- 新着コメント








注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
侍エンジニア塾のC言語のサンプルがヤバすぎる。
# include <stdio.h> # include <stdlib.h> // 構造体の宣言 typedef struct { int num; char *str; } s... # include <stdio.h> # include <stdlib.h> // 構造体の宣言 typedef struct { int num; char *str; } strct; int main(void) { // 実体を生成 strct *entity; // 動的メモリの確保。確保したメモリをstrct型ポインタにキャスト。 entity = (strct*)malloc(sizeof(strct)); // メンバの初期化 entity->num = 0; entity->str = (char*)malloc(sizeof(32)); // メモリに文字列を代入 sprintf(entity->str, "%s %s!", "Hello", "World"); printf("%s\n", entity->str); // メモリの解放 free(entity->
2018/10/17 リンク