LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-13-2005, 02:23 PM   #1
Mistro116@yahoo.com
Member
 
Registered: Sep 2005
Posts: 118

Rep: Reputation: 15
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
 
Old 11-13-2005, 02:36 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you pasted 190 lines of comments for 2 lines of code?

Anyway... as you've not included stdio.h, it won't be aware of the FILE struct. add an include at the top.
 
Old 11-13-2005, 02:38 PM   #3
Mistro116@yahoo.com
Member
 
Registered: Sep 2005
Posts: 118

Original Poster
Rep: Reputation: 15
Thanks, brilliant
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
in gcc compiler error: parse error before string constsnt cynthia_thomas Linux - Networking 1 10-20-2005 01:29 AM
parse error with bc fisayo Programming 7 08-04-2005 09:23 AM
Parse Error verbatim Programming 3 04-22-2005 09:16 AM
parse error? ams Programming 5 03-02-2005 04:56 AM
What is parse error ? edhan Linux - Newbie 64 09-17-2003 06:49 AM


All times are GMT -5. The time now is 12:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration