Click here to Skip to main content
15,910,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Release Version Of Code Library Pin
Jim Crafton27-Aug-02 6:26
Jim Crafton27-Aug-02 6:26 
GeneralLaunch a dialog box in a doc/view Pin
Anonymous27-Aug-02 5:14
Anonymous27-Aug-02 5:14 
GeneralRe: Launch a dialog box in a doc/view Pin
Tomasz Sowinski27-Aug-02 5:17
Tomasz Sowinski27-Aug-02 5:17 
GeneralRe: Launch a dialog box in a doc/view Pin
Rico62127-Aug-02 16:39
Rico62127-Aug-02 16:39 
GeneralRe: Launch a dialog box in a doc/view Pin
Tomasz Sowinski27-Aug-02 22:24
Tomasz Sowinski27-Aug-02 22:24 
GeneralInstallShield's CallDLLFx Pin
achandra00727-Aug-02 5:09
achandra00727-Aug-02 5:09 
GeneralRe: InstallShield's CallDLLFx Pin
Stephane Rodriguez.27-Aug-02 7:52
Stephane Rodriguez.27-Aug-02 7:52 
GeneralDid I Miss Something Here... Pin
Nick Parker27-Aug-02 4:44
protectorNick Parker27-Aug-02 4:44 
Ok, after the first day back to school I am working on a little app, which is an assignment. I am not asking for anyone to do it for me, however this error doesn't make sense to me. Here is the contents of my header file:

//==============================
//
// Nick Parker
// nparker@iastate.edu
// hw1.h
//
//==============================


#ifndef HW1_H
#define HW1_H

#include <fstream.h>
#include <iomanip.h>


//==============================
// Application file names
//==============================

#define ListOfDivers "divers.dat"
#define OutputFile "output.dat"
#define ReportFile "report.dat"


//==============================
// Constant variables
//==============================

const int Total_Divers = 24;
const int Best_Divers = 12;
const int Num_Of_Dives = 10;
const int Num_Of_Scores = 7;



//==============================
// Create Data Structures
//==============================

struct Dive_Stats
{
	float difficulty;
	float scores[Num_Of_Scores];
};

struct Diver_Info 
{
	char Diver_Name[80];
	Dive_Stats Dives[Num_Of_Dives];
	float Total_Score;
};


//==============================
//
// Function Prototypes
//
//==============================


void Input_Data(Diver_Info []);
void Calculate_Totals(Diver_Info []);
void Create_Report(Diver_Info []);
void Sort_Divers_Scores(Diver_Info []);
void Create_Output(Diver_Info []);



#endif


When I am compiling I get several errors that point to my two structures. The first error points to
float scores[Num_Of_Scores];

saying error C2057: expected constant expression. Does that make sense?? Confused | :confused:

Thanks for any tips.

Nick Parker


GeneralRe: Did I Miss Something Here... Pin
Chris Hambleton27-Aug-02 5:01
Chris Hambleton27-Aug-02 5:01 
GeneralRe: Did I Miss Something Here... Pin
Chris Losinger27-Aug-02 5:02
professionalChris Losinger27-Aug-02 5:02 
GeneralRe: Did I Miss Something Here... Pin
Nick Parker27-Aug-02 5:07
protectorNick Parker27-Aug-02 5:07 
GeneralRe: Did I Miss Something Here... Pin
Tomasz Sowinski27-Aug-02 5:00
Tomasz Sowinski27-Aug-02 5:00 
GeneralRe: Did I Miss Something Here... Pin
Nick Parker27-Aug-02 5:13
protectorNick Parker27-Aug-02 5:13 
GeneralRe: Did I Miss Something Here... Pin
Nick Parker27-Aug-02 5:04
protectorNick Parker27-Aug-02 5:04 
GeneralRe: Did I Miss Something Here... Pin
Tomasz Sowinski27-Aug-02 5:08
Tomasz Sowinski27-Aug-02 5:08 
GeneralRe: Did I Miss Something Here... Pin
markkuk27-Aug-02 5:41
markkuk27-Aug-02 5:41 
GeneralRe: Did I Miss Something Here... Pin
Roger Allen27-Aug-02 6:11
Roger Allen27-Aug-02 6:11 
QuestionChoosing the best view? Pin
kc5zrs27-Aug-02 4:42
kc5zrs27-Aug-02 4:42 
AnswerRe: Choosing the best view? Pin
Tomasz Sowinski27-Aug-02 4:51
Tomasz Sowinski27-Aug-02 4:51 
GeneralFiguring out someone else's program Pin
Like2Byte27-Aug-02 4:14
Like2Byte27-Aug-02 4:14 
GeneralRe: Figuring out someone else's program Pin
Tomasz Sowinski27-Aug-02 4:20
Tomasz Sowinski27-Aug-02 4:20 
GeneralRe: Figuring out someone else's program Pin
Like2Byte27-Aug-02 4:35
Like2Byte27-Aug-02 4:35 
QuestionHow to speed up from DDB to DIB?Emergency Pin
csqlhy27-Aug-02 4:14
csqlhy27-Aug-02 4:14 
AnswerRe: How to speed up from DDB to DIB?Emergency Pin
Tomasz Sowinski27-Aug-02 4:18
Tomasz Sowinski27-Aug-02 4:18 
GeneralThrowing an exception from a constructor Pin
Le centriste27-Aug-02 3:57
Le centriste27-Aug-02 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.