【板名】プログラム
【スレ名】C言語なら俺に聞け(入門篇) Part 7
【スレのURL】http://pc10.2ch.net/test/read.cgi/tech/1170064980/
【名前欄】
【メール欄】sage
【本文】↓
構造体内のポインタにgets()で文字列等を代入できるのでしょうか?
#include<stdio.h>
#include<string.h>
struct{
int num;
char word;
}*str;
main(){
char temp[10];
gets(str->word);
gets(temp);
str->num=(int)atoi(temp);
(以下省略)
という感じでやっているとコンパイルエラーは無いのですが強制終了してしまいますorz
ご教授お願いします