Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions

Question

What are conversion costs? What are prime costs?

Answered: 1 week ago