No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
void main() { int number; totalCallsPtr pcall=NULL; getData(&pcall,&number); } void getData(totalCallsPtr* pcall,int* number)//get data from the text file { int i,n; FILE *f1; f1=fopen(INPUT, "r"); if (f1==NULL) printf("File not open!\n"); else { fscanf(f1,"%d",&n); *pcall=((totalCallsPtr)malloc(n*sizeof(CALL))); } if((*pcall=(totalCallsPtr)malloc(n*sizeof(CALL)))==NULL) printf("not enough memory to allocate"); for(i=0;i<n;i++) { fscanf(f1,"%d ",&pcall[i]->day); fscanf(f1,"%d:%d:%d ",&pcall[i]->startCall.hours,&pcall[i]->startCall.minutes,&pcall[i]->startCall.seconds); fscanf(f1,"%d:%d:%d ",&pcall[i]->endCall.hours,&pcall[i]->endCall.minutes,&pcall[i]->endCall.seconds); fscanf(f1,"%c",&pcall[i]->type); … |
|
Hi everyone i really need your help i need to write a code for a game in tow dimensional array [6][5] that 2 people are playing its like X O but the size is of the storck is decieded by them every player picks the colmun he wants to put … |