-
Functions and pointers
hey guys.
i have to write a difficult program to take student grades and compute them. i am defedently going to need more help on this later. the one problem i am having right now that i cant seem to figure out is that my compiler is saying "syntax error before int" it says this on the line in my program that says processOneStudent(int*numStudentPtr........) it is in main. can you just help me figure out why it is saying that??? here is my code. dont make fun its not even close to finish yet.
Code:
#include <stdio.h>
void welcome(void);
void processOneStudent(int *numStudentsPtr, int *studentIdPtr, int *yearPtr, int *cumulativeHoursPtr, float *cumulativeGPAPtr);
void reportStudentData(int studentId, int class, int cumulativeHours, float cumulativeGPA);
int applyCriteria(void);
void reportSummary(void);
char more_students;
int main(){
welcome();
printf("More Students (Y or N):\t");
scanf("%c", &more_students);
if(more_students=='Y'||'y'){
processOneStudent(int *numStudentsPtr, int *studentIdPtr, int *yearPtr, int *cumulativeHoursPtr, float *cumulativeGPAPtr); \\here is my problem
else if(more_students=='N'||'n')
}
system ("pause");
return 0;
}
void welcome(void){
printf("\n%s%s%s%s\n",
"***********************************************\n\n",
"* Welcome to the Academic Standing System *\n\n",
"* Developed by Drem Darios *\n\n",
"***********************************************\n");
}
void processOneStudent(int *numStudentsPtr, int *studentIdPtr, int *yearPtr, int *cumulativeHoursPtr, float *cumulativeGPAPtr ){
int hours;
int grade;
printf("Enter student id, class, cum. hours, cum. GPA:\t");
scanf("%d%d%d%f", &studentIdPtr, &yearPtr, &cumulativeHoursPtr, &cumulativeGPAPtr);
printf("Hours and grade (0 0 to end)?\t");
scanf("%d%d", &hours, &grade);
while ( hours<0 && grade<0){
printf("Hours and grade (0 0 to end)?\t");
scanf("%d%d", &hours, &grade);
}
}
void reportStudentData(int studentId, int year, int cumulativeHours, float cumulativeGPA){
printf("Student Id:\t%d\n", studentId);
printf("Class:\t%d\n", year);
printf("New Cumulative Hours:\t%d\n", cumulativeHours);
printf("New Cumulative GPA:\t%.2f\n", cumulativeGPA);
}
void reportSummary(int numStudents, int numInGoodStanding){
printf("Number of Students:\t%d\n", numStudents);
printf("Number in Good Standings\t%d\n",numInGoodStanding);
printf("\nThank you for using the Academic Standing System. Bye bye!");
}
-
Please dont cross post the same topic again.
ssharish