I know it is a simple question but I am stuck.The code is:
#include <stdio.h>
#define MAX_SIZE 1025
#define NUM 64
int main(){
int mem_size;
char types[NUM];
char values[MAX_SIZE];
fgets(types,NUM,stdin);
printf("%s",types);
fgets(values,MAX_SIZE,stdin);
printf("%s",values);
scanf("%d",&mem_size);
printf("%d",mem_size);
return 0;
}
Although I want the results after I type and hit enter, the flow is: I need to enter all the fgets and scanf stuff and it correctly prints the desired results. What is the problem? Please help.