error C2447: '{' : missing function header (old-style formal list?)

It has an error.. it always says that error C2447: '{' : missing function header (old-style formal list?)

Please help me ... I am having a hard time running this code of mine.
I can't find what is my error in this code:

Last edited on
void money();

The semi-colon should only be there on the function declaration (at the top of your code), not in the definition (at the bottom of your code).
How would it look like? can you please show me where do I need to put my semicolon? I tried to remove the semicolon in void money(); at the bottom and same with other functions.. but it says that void must have ; semicolon.
Last edited on
It's okay now. its working , i accidentally didnt notice that there is a semicolon left in void on the upper part. THANKS! IT REALLY HELPS :D
OP for reference:

It has an error.. it always says that error C2447: '{' : missing function header (old-style formal list?)

Please help me ... I am having a hard time running this code of mine.
I can't find what is my error in this code:


#include "stdafx.h"
#include <iostream>
#include <cstdlib>
using namespace std;
void stars(void);
void sphere();
void money();
void convert();
void disp(char ch,int crt);

int main ()

{

stars();
cout<<" MENU \n";
stars();

char choice;
while(1)
{
system("cls");
disp('*',20);
cout<<" M E N U"<<endl;
disp('*',20);
cout<<"[s] - sphere\n";
cout<<"[m] - money\n";
cout<<"[c] - convert\n";
disp('*',20);
cout<<"Enter your choice:";
cin>>choice;
switch (choice)
{
case's':
case'S':
sphere();
break;


case'm':
case'M':
money();
break;

case'c':
case'C':
convert();
break;


default:
cout<<"Please type a letter that is among the choices";
}
system("pause > 0");
}
}

void stars(void)
{
cout<<"*****************************************************\n";
}
void sphere();
{
cout<<"\nGetting the volume of the sphere";
}

void money();
{
cout<<"\nConverting dollars to php";
}
void convert();
{
cout<<"\nConvertion of temperature";
}

void disp(char ch, int crt)
{
for(int i=0;i<<crt;i++)
cout << ch;
cout<<endl;
}

Topic archived. No new replies allowed.