i did that already still it says error.. C2447: missing function header (old-style formal list?) im doing this for hours but still cant figure it out.. =(
I am having trouble with this C++ code. Can anybody help me?
#include <iostream>
#include <string>
#include <iomanip>
//prototypes
char toDigit(char&);
char readDial(char&,char&,char&,char&,char&,char&,char&,char&);
char acknowledgeCall(char d1,char d2,char d3,char d4,char d5,char d6,char d7,char d8);
char d1, d2, d3, d4, d5, d6, d7, d8;
using namespace std;
int main()
{
char readDial(char&,char&,char&,char&,char&,char&,char&,char&);
int returnValue = 0;
while (returnValue != -5)
{
switch(returnValue)
{
case -1: cout << "ERROR - An invalid character was entered" << endl; break;
case -2: cout << "ERROR - Phone number cannont begin with 0" << endl; break;
case -3: cout << "ERROR - Phone number cannont begin with 555" << endl; break;
case -4: cout << "ERROR - Hyphen is not in the correct position" << endl; break;
case -5: cout << "Good-bye" << endl; break;
default: acknowledgeCall(d1, d2, d3, d4, d5, d6, d7, d8);
}
}
return 0;
}
char toDigit(char&);
{
toupper(d);
switch(d)
{
case 'A': case 'B': case 'C':
d = '2'; break;
case 'D': case 'E': case 'F':
d = '3'; break;
case 'G': case 'H': case 'I':
d = '4'; break;
case 'J': case 'K': case 'L':
d = '5'; break;
case 'M': case 'N': case 'O':
d = '6'; break;
case 'P': case 'Q': case 'R': case 'S':
d = '7'; break;
case 'T': case 'U': case 'V':
d = '8'; break;
case 'W': case 'X': case 'Y': case 'Z':
d = '9'; break;
}
}
char readDial(char& d1, char& d2, char& d3, char& d4, char& d5, char& d6, char& d7, char& d8);
{
int retunValue;
cout << "Please enter a phone number or . to quit: " << endl;
cin >> d1 >> d2 >> d3 >> d4 >> d5 >> d6 >> d7 >> d8;
if (d1 == '.')
{
return -5;
}
if (d1 == 0)
{
return - 2;
}
if (d1 == 5 && d2 == 5 && d3 == 5)
{
return -3;
}
if (d4 != '-')
{
return -4;
}
if (result == -1)
return -1;
if (ToDigit(d1,d2,d3,d5,d6,d7,d8) == -1)
return -1;