»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 04-01-2004, 07:04 PM   #1 (permalink)
Registered User
 
Join Date: Jun 2003
Location: Maine
Posts: 24
Elburn is on a distinguished road
C++ struct and code start help

I keep getting an error when I compile this code and I can't figure out why. It tells me I have an error on the line that says "//defining the struct" It says there is a missing ';' and it unexpectedly found the end of file. I thought I had declared everything correctly (and the function calls and func. definitions are correct in the code). Am I doing something wrong here?

-Stephen

Code:
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;

void NameBanner(ostream& out, int pp_num)

struct Potential 
{					//Defining the struct
		int studid;
		double gpa;
		int prelim1;
		int prelim2;
		int prelim3;
		double progavg;
		int final;
		char grade;
};

int recfunc(Potential& potent)

int main()
{

Elburn is offline   Reply With Quote
Old 04-01-2004, 08:05 PM   #2 (permalink)
Registered User
 
krohnjw's Avatar
 
Join Date: Oct 2001
Location: ~/
Posts: 2,567
krohnjw is on a distinguished road
Send a message via AIM to krohnjw
void NameBanner(ostream& out, int pp_num)

should be

void NameBanner(ostream& out, int pp_num);

You will need a ; after your function headers, the same after the recfunc function.
krohnjw is offline   Reply With Quote
Old 04-01-2004, 08:17 PM   #3 (permalink)
Registered User
 
Join Date: Jun 2003
Location: Maine
Posts: 24
Elburn is on a distinguished road
Oh, whoops.

That fixed it, thanks.

-Stephen
Elburn is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 03:45 PM.