I have a program for class that I must write using functions. Before I continued with the program I wanted to see if I could get my initial call to my first function working. Have not had luck though. Here are the error messages I'm recieving:
"error LNK2019: unresovled external symbol_main referenced in function_tmainC RTStartup"
"fatal error LNK1120: 1 unresolved externals"
Here's a copy of my code:
What am I doing wrong with the syntax? Thanks for any help!
"error LNK2019: unresovled external symbol_main referenced in function_tmainC RTStartup"
"fatal error LNK1120: 1 unresolved externals"
Here's a copy of my code:
Code:
#include <iostream>
using namespace std;
// Function prototypes
void printError();
void getInput(int&, char&);
void printLastLine(int, char);
int printPattern(int, char);
int main()
{
int numRows;
char typeChar;
getInput();
// printPattern(inputNum, inputChar);
// printLastLine(inputNum, inputChar);
return 0;
}
//************************************************************************
// Definition of getInput which obtains user info on how to build pattern*
//************************************************************************
void getInput(int&, char&)
{
int inputNum = 0;
char inputChar = 0;
cout << "How many rows do you want in the pattern (even numbers only: 2-14)?\n";
cin >> inputNum;
cout << "What character do you want the pattern made of (select: * + # or $)?\n";
cin >> inputChar;
printError(inputNum&, inputChar&);
return;
}
//************************************************************************
// Definition of printError which acts as input validation when program *
// is obtaining number and type of pattern to be used by user *
//************************************************************************
void printError ()
{
if ((inputNum < 2) || (inputNum > 14) ||(inputNum%2 != 0))
cout << "Invalid number of rows. Please retry.";
getinput();
// Code here for 2nd validation (How to compare multiple literal strings?)
return;
}
Comment