No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "queue.h" #include "stack.h" #define NAME_SIZE 20 #define RECORDS_SIZE 100 typedef struct { char studName[20]; int timeEnter; int timeUpdate; }STUDENT; typedef struct { char tutorName[NAME_SIZE]; int tutorTime; STUDENT *ptr; }TUTOR; QUEUE *queue1; STACK *stack1; void getData(STUDENT *studArr[], TUTOR tutorArr[1]); int main(void) { STUDENT *studArr[RECORDS_SIZE]; … |
|
why I am trying to dynamically allocate memory for this pointer to array of structure I have STUDENT *studArr[] where STUDENT is the name of the structure I tried to allocate like this #include <stdio.h> #include <stdlib.h> #include <string.h> #include "queue.h" #include "stack.h" #define NAME_SIZE 20 #define RECORDS_SIZE 100 typedef … |
|
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 typedef struct { char *name; int score; }RECORD; float calMean(RECORD list[], int count); void sortData(RECORD list[], int count); int main (void) { // Declarations float mean; float median; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count … |
|
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 float calMean(RECORD list[].score, int count); typedef struct { char *name; int score; }RECORD; int main (void) { // Declarations float mean; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count = 0; int i; // Statements printf("Enter … |