need help with error - cout is ambiguous

I am at a loss as to what to do, each cout has a red line underneath it and says that it is ambiguous and the debug goes haywire when I attempted to run it. Is something wrong with the compiler or did I make some obvious mistake that I missed. This is the code if needed. I am using Microsoft visual studio 2010 if that makes a difference. I am sure there are other minor errors within the program unrelated to this particular issue that I will be able to fix once I can get the program functioning. Thank you for any help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>
#include <iomanip>
using namespace std;

char W, D, I, Q, Z, initchar, transtype;
int balance, account, withdraw, deposit;
void instruct1 ();
void instruct2 ();

cout << fixed << showpoint << setprecision(2);
void main()
{
	instruct1 ();
		do
		{
			cout << "Enter (I)nitial account type or (Q)uit: ";
			cin >> initchar;
			initchar = toupper (initchar);
		}	while (initchar != 'Q');

			if (initchar == 'I')
		{
			do
			{
				cout << "Enter account number: "; cin >> account;
				cout << endl << "Enter the initial balance: "; cin >> balance;
				instruct2 ();
				cout << "Enter first letter of transaction type (W, D, or Z): "; cin >> transtype;
				transtype = toupper (transtype);
			}	while (transtype != 'Z');
			{
				if (transtype == 'W')
				{
					cout << "Amount: $"; cin >> withdraw;
					balance -= withdraw;
					cout << "Balance for this account is now: $" << balance << endl << endl;
				}
				else if (transtype == 'D')
				{
					cout << "Amount: $"; cin >> deposit;
					balance += deposit;
					cout << "Balance for this account is now: $" << balance << endl << endl;
				}
				else
				{
					cout << "Illegal transaction type, re-enter";
					cout << "Balance for this account is now: $";
				}
			}
		}
		else
		{
			 cout << "Bad initial account data, re-enter: "; cin >> initchar;
			 initchar = toupper (initchar);
		}
	}

void instruct1 ()
{
	cout << "SAVINGS ACCOUNT TRANSACTION PROGRAM. " << endl <<
		"When prompted, enter an 'I' for the initial account " << endl <<
		"information or 'Q' to terminate program execution. " << endl <<
		"Then enter the account number followed by the initial " << endl <<
		"account balance. All subsequent transactions are " << endl <<
		"denoted as follows: " << endl << "(W) for withdrawal " << endl <<
		"(D) for deposit " << endl <<
		"(Z) to end account transactions for this account " << endl << endl;
}
void instruct2 ()
{
	cout << "SAVINGS ACCOUNT TRANSACTION " << endl <<
		"(W)ithdrawel " << endl << "(D)eposit" << endl << "(Z) to end transaction" << endl;
}
You may not use this statement

cout << fixed << showpoint << setprecision(2);


outside any function. Only declarations can be placed outside a function.

Also function main shall be declared as

int main()

Last edited on
Thanks. That did it.
Topic archived. No new replies allowed.