Error C26062 type 'int' unexpected

I'm having trouble with my first university project with the error stated above
Here are the errors:
Error C2064: term does not evaluate to a function taking 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
#include <iostream>
using namespace std;
//prototype declarations
void IsolateDigits();
void replaceDigits();
void swapDigit1WithDigit3();
void recomposeEncryptedNumber();

	int main()
{
int Onumber, Key, encryptedNumber,replaceDigits, 
swapDigit1WithDigit3, recomposeEncryptedNumber;
	
cout<<"Enter the original three-digit number:"; //read in a (three-digit) number
	cin>>Onumber;
	cout<<"Please enter the key: ";
	cin>>Key;					//read in a (one-digit) number
	IsolateDigits;
	replaceDigits;
	swapDigit1WithDigit3;
	recomposeEncryptedNumber;
	cout<<"The encrypted number for ", Onumber, " is ", encryptedNumber;
	return 0;
	}


EDITED VERSION FIXED
Last edited on
There's a whole lot of errors there. Let's start with this, fix the "using" statement and add the declarations for the function prototypes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
using namespace std;

// protoytype declarations
void replaceDigits();
void IsolateDigits();
void swapDigit1WithDigit3();
void recomposeEncryptedNumber();

int main()
{
    // etc.
    return 0;
}


I would say it's a good idea to compile the code often and fix the errors as you go along, rather than type a lot of stuff and find that it's wrong, and have to go back and change it all.
Last edited on
thanks for pointing out the 'using' and I have uploaded an edited version
Look up the syntax for how to call function; you're doing it incorrectly in main().
I've fixed it now, all working now thanks Chervil!
It would help if you used [code]your code here[/code] tags. Then it would be possible to refer to your program by line number.

Here, you have this declaration: void IsolateDigits(); which makes sense. Then inside main(), you declare an integer with the same name. That does not make sense. After that you make a call to the function, which would be valid, but for the intervening error.

Of course you will later have to add back in the body of the function, but one step at a time. skeleton version:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
void replaceDigits(); // declaration

int main()
{
    replaceDigits(); // call the function
    
    return 0;
}

void replaceDigits()
{
    // here put the code which 
    // defines the body of the function.    
}

Thank you Chervil my program is working, (FOR NOW)!
Topic archived. No new replies allowed.