I ..need help

I'm taking this intro class, and this is one of the last things we have to do, but I can't seem to figure it out, and it's due tomorrow. Can some one fix whatevers wrong with this? I thought it was fine, but apparently it "function does not take 0 arguments"

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


#include "stdafx.h"
#include "math.h"
#include <iostream>
#include <iomanip>
#include <cctype>
using namespace std;

int n, Twid, Rhei, Rwid;
int triangle(int &b, int &ch)
	{
		
	 
	cout << "\nYou have selected a triangle.\nPlease choose your base width.\nValue must be >1 and <20";
	cout << "Height:";	cin >> ch ;
		cout << "Width:"; cin >> b;
		if ( ch > 1 )

	cout << ch << "and" << b;
		return b;
	
		}
int rectangle(int &c, char &dk)
	{
	
	cout << "\nYou have selected a rectangle.\nPlease enter your height and width.\nAlso enter +, -, or * for shape type.\nHeight:";

	cin >> c ;
	cout << "Width:"; cin >> dk;
	if (islower(dk))
		cout << static_cast<char>(toupper(dk)) << c;
	return c;
	
}    // this must match the header that starts your function definition below
int _tmain(int argc, _TCHAR* argv[])
{
	do 
	{
		cout << "Please choose a figure:\nRectangle = 1\nTriangle = 2\n";
		cin >> n;
		if ( n == 1 ) 
		{ triangle(); }   
		else if ( n == 2 ) {rectangle(); } 
		else if ( n != 1 || n != 2 ) { cout << "Invalid selection, try again."; }
	} 
	while ( n > 0 )
		;
		return 0;
}
In line 42 you call triangle();, but your declaration says that this function has two integer arguments.

The same story is in line 44.
Topic archived. No new replies allowed.