Click here to Skip to main content
15,915,163 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MAPI Pin
Michael P Butler5-May-04 1:50
Michael P Butler5-May-04 1:50 
GeneralFileNotFoundException - File or assembly name.. or.. dependencies.. not found Pin
Member 24974064-May-04 19:11
Member 24974064-May-04 19:11 
GeneralTrouble using SetDCBrushColor Pin
myanonym4-May-04 17:47
myanonym4-May-04 17:47 
GeneralRe: Trouble using SetDCBrushColor Pin
PJ Arends4-May-04 19:11
professionalPJ Arends4-May-04 19:11 
GeneralExport DLL to two processes Pin
Anonymous4-May-04 17:46
Anonymous4-May-04 17:46 
GeneralRe: Export DLL to two processes Pin
Jitendra gangwar4-May-04 21:04
Jitendra gangwar4-May-04 21:04 
GeneralRe: Export DLL to two processes Pin
jetournier5-May-04 2:24
jetournier5-May-04 2:24 
GeneralUnexplained error - Declaration terminated incorrectly Pin
tunerica4-May-04 17:20
tunerica4-May-04 17:20 
I am writing some fairly simple code for a uni assignment and I have this error come up in a couple of instances "Declaration terminated incorrectly", I have checked the code over many times and just can't seem to work out the problem. The error occurs when I compile barDrv.cpp, and the error is in CustomerOrder.h on line 10. Here the code for the two files:

barDrv.cpp

//File: barDrv.cpp
//Test harness for assignment

#include <iostream>
#include "CustomerOrder.h"
#include "Bar.h"


static const int MAX_ITEMS_IN_CUSTOMER_ORDER = 15;
static const int MAX_ITEMS_IN_BAR_MENU = 40;

int main()
{
char choice;
int nextMenu = 1;
Bar theBar(MAX_ITEMS_IN_BAR_MENU);
CustomerOrder theCustomerOrder(MAX_ITEMS_IN_CUSTOMER_ORDER);

theBar.maintainStock();

do
{
theBar.printBar();
cin>>choice;


switch(choice)
{

case 'Q':
cout<<"Thankyou for using Tunerica Corporations software!";
nextMenu = 0;

case 'I':
int number;

theBar.printInclude();
cin>>number;
theCustomerOrder.includeItem(number, theBar);

case 'X':
int number2;
theCustomerOrder.printExclude();
cin>>number2;
theCustomerOrder.excludeItem(number2);

case 'P':
char whatToDo;
theCustomerOrder.printInvoice();
cin>>whatToDo;

if (whatToDo == 'Y')
theCustomerOrder.~CustomerOrder();

else
nextMenu = 0;
}

}while(nextMenu!=0);

return 0;


}



CustomerOrder.h

//File CustomerOrder.h
//Interface for the CustomerOrder class

#ifndef CUSTOMERORDER_H
#define CUSTOMERORDER_H

#include <string>
#include "Bar.h"

using namespace std; <<<<<-Where the error apparently is

class CustomerOrder
{
public:
CustomerOrder(int maxItems);
~CustomerOrder();
void includeItem(int choice, Bar aBar);
void excludeItem(int choice);
void printExclude();
void printInvoice();

private:
int numInInvoice;
int numItemsInvoice;
double calcTotal();
Item * * invoice;

};

#endif



Any help or suggestions would be greatly appreciated.

Thanks in advance.
GeneralRe: Unexplained error - Declaration terminated incorrectly Pin
John R. Shaw4-May-04 18:54
John R. Shaw4-May-04 18:54 
GeneralRe: Unexplained error - Declaration terminated incorrectly Pin
tunerica4-May-04 23:17
tunerica4-May-04 23:17 
GeneralNeed Simple Code to Display a JPG on a Dialog Window Pin
toothless boots4-May-04 16:55
toothless boots4-May-04 16:55 
GeneralRe: Need Simple Code to Display a JPG on a Dialog Window Pin
Monty24-May-04 18:57
Monty24-May-04 18:57 
Generaltranslate this code from Ansi C to C++ (file related) Pin
kfaday4-May-04 16:19
kfaday4-May-04 16:19 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Christian Graus4-May-04 16:53
protectorChristian Graus4-May-04 16:53 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Joe Woodbury4-May-04 19:47
professionalJoe Woodbury4-May-04 19:47 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Anonymous4-May-04 20:22
Anonymous4-May-04 20:22 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
RChin4-May-04 23:15
RChin4-May-04 23:15 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
toxcct4-May-04 23:36
toxcct4-May-04 23:36 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Prakash Nadar5-May-04 0:05
Prakash Nadar5-May-04 0:05 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Maxwell Chen5-May-04 0:49
Maxwell Chen5-May-04 0:49 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
RChin5-May-04 0:53
RChin5-May-04 0:53 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Maxwell Chen6-May-04 16:05
Maxwell Chen6-May-04 16:05 
GeneralRe: translate this code from Ansi C to C++ (file related) Pin
Joe Woodbury5-May-04 6:38
professionalJoe Woodbury5-May-04 6:38 
GeneralSetTimer Pin
Anonymous4-May-04 15:48
Anonymous4-May-04 15:48 
GeneralRe: SetTimer Pin
Monty24-May-04 18:59
Monty24-May-04 18:59 

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.