Thread: Functions and pointers

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    71

    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!");
         }

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Please dont cross post the same topic again.

    ssharish

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Conversion of pointers to functions
    By hzmonte in forum C Programming
    Replies: 0
    Last Post: 01-20-2009, 01:56 AM
  2. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  3. Passing pointers between functions
    By heygirls_uk in forum C Programming
    Replies: 5
    Last Post: 01-09-2004, 06:58 PM
  4. API "Clean Up" Functions & delete Pointers :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-10-2002, 06:53 PM
  5. pointers, functions, parameters
    By sballew in forum C Programming
    Replies: 3
    Last Post: 11-11-2001, 10:33 PM