LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Parse Error, but why? (https://www.linuxquestions.org/questions/programming-9/parse-error-but-why-382765/)

Mistro116@yahoo.com 11-13-2005 02:23 PM

Parse Error, but why?
 
Does anyone know why I get the following parse error for my header file?

This language is C:

Code:

/***********************************************************
 *  Function: ReadNumberOfItems
 *  Usage: int numberOfItems = ReadNumberOfItems
 *                              (FILE *inputFilePointer);
 *
 *  This function will be responsible for reading the first
 *  line of the data file, which will contain an integer
 *  value that represents number of items that data file
 *  contains, and returning this value.
 *
 *  Input: FILE* inputFilePointer - a local FILE pointer
 *                                    variable that will
 *                                    reference the data file
 *                                    that is open.
 *  Output: int numberOfItems - returns the number of items
 *                                that the data file contains.
 *
 **********************************************************/

int ReadNumberOfItems (FILE* inputFilePointer);

/***********************************************************
 *  Function: ReadStudentInformation
 *  Usage: ReadStudentInformation (FILE* inputFilePointer,
 *                                  STUDENT students [ ],
 *                                  int numberOfItems);
 *
 *  This function will be responsible for reading all of
 *  the information for each student from the data file and
 *  storing it into the proper index of the STUDENT
 *  structure, students [ ], int numberOfItems amount of
 *  times, which will denote each of the students that the
 *  data file contains information about.
 *
 *  Inputs: FILE* inputFilePointer - a local FILE pointer
 *                                    variable that will
 *                                    reference the data file
 *                                    that is open.
 *            STUDENT students [ ] -  a local STUDENT array
 *                                    variable that will
 *                                    contain the login,
 *                                    last name, first name,
 *                                    sex, major, section,
 *                                    class, proj1 grade,
 *                                    proj2 grade, proj3
 *                                    grade, proj4 grade,
 *                                    proj5 grade, lab1
 *                                    grade, lab2 grade,
 *                                    lab3 grade, lab4 grade,
 *                                    lab5 grade, lab6 grade,
 *                                    lab7 grade, lab8 grade,
 *                                    lab9 grade, lab10
 *                                    grade, lab11 grade,
 *                                    lab12 grade, midterm
 *                                    grade, and final exam
 *                                    grade for each student.
 *            int numberOfItems -      a local integer
 *                                    variable that contains
 *                                    the number of items
 *                                    that the data file
 *                                    contains.
 *  Output: None - this function takes a void return-type.
 *
 **********************************************************/

int ReadStudentInformation (FILE* inputFilePointer,
                            STUDENT students [ ],
                            int numberOfItems);

Code:

students.h:147: error: parse error before '*' token
students.h:193: error: parse error before '*' token

Anyone know why it doesn't like "File* inputFilePointer"?

Thanks, mistro116

acid_kewpie 11-13-2005 02:36 PM

you pasted 190 lines of comments for 2 lines of code? :rolleyes:

Anyway... as you've not included stdio.h, it won't be aware of the FILE struct. add an include at the top.

Mistro116@yahoo.com 11-13-2005 02:38 PM

Thanks, brilliant :)


All times are GMT -5. The time now is 07:34 PM.