expectedRuntime 変数を出力しようとすると、expectedRuntime のアドレスが出力されます。しかし、timeOfSubmission 変数を正しく出力できます。誰でも私を助けてくれますか?
struct process
{
int timeOfSubmission;
int remainingRunTime;
int expectedRunTime;
char processName[20];
};
int main()
{
FILE *myInput;
myInput = fopen("input.txt", "r+");
while ( !feof(myInput) )
{
struct process * newProcess=(struct process *)malloc(sizeof(struct process));
fscanf(myInput, "%s", newProcess->processName);
fscanf(myInput, "%d", & (newProcess->expectedRunTime) );
(newProcess->expectedRunTime)=(newProcess->remainingRunTime);
fscanf(myInput, "%d", & (newProcess->timeOfSubmission) );
printf("%s ",newProcess->processName);
fflush(stdout);
printf("%d ",newProcess->expectedRunTime);
fflush(stdout);
printf("%d \n",newProcess->timeOfSubmission);
fflush(stdout);
}
return 0;
}