Question: Severity Code Description Project File Line Suppression State Message LNT1006 Local variable is not initialized. ConsoleApplication51 C:Usersallensource eposConsoleApplication51ConsoleApplication51.cpp 16 Error C2084 function 'int main(void)' already
| Severity | Code | Description | Project | File | Line | Suppression State |
| Message | LNT1006 | Local variable is not initialized. | ConsoleApplication51 | C:\Users\allen\source epos\ConsoleApplication51\ConsoleApplication51.cpp | 16 | |
| Error | C2084 | function 'int main(void)' already has a body | ConsoleApplication51 | C:\Users\allen\source epos\ConsoleApplication51\ConsoleApplication51.cpp | 14 | |
| Message | see previous definition of 'main' | ConsoleApplication51 | C:\Users\allen\source epos\ConsoleApplication51\ConsoleApplication51.cpp | 6 |
Why the errors?
// ConsoleApplication51.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include
int main()
{
std::cout
}
#include
using namespace std;
int main(){
int oldestPeople[5]; // Source: Wikipedia.org
int nthPerson = 1; // User input, Nth oldest person
oldestPeople[0] = 122; // Died 1997 in France
oldestPeople[1] = 119; // Died 1999 in U.S.
oldestPeople[2] = 117; // Died 1993 in U.S.
oldestPeople[3] = 117; // Died 1998 in Canada
oldestPeople[4] = 116; // Died 2006 in Ecuador
cout
cin >> nthPerson;
if ((nthPerson >= 1) && (nthPerson =>
cout
cout
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
