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
#include <iostream>
usingnamespace 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;
}
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.
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.
}