Help With C++ Very Basic

Status
Not open for further replies.
its not liking the main I normally do:

int main()

OR

void main()

such as:

#include <iostream>
#include <string>
using namespace std;

int main ()
{

unsigned int Age;
int StartEnergy;
string CharacterType;

/* Get the Information */
std::cout << "What is your Character's Age?: ";
std::cin >> Age;
std::cout << "How much start Energy?: ";
std::cin >> StartEnergy;
std::cout << " Character Race?: ";
std::cin >> CharacterType;

/*Show the information */
std::cout << "Your chacter is " << Age << " years old." << std::endl;
std::cout << "Has " << StartEnergy << " of starting energy." << std::endl;
std::cout << "And its race is " << CharacterType << "."<< std::endl;
system("pause");
return 0;

I changed some of your program mainly the variable types made age an int and startenergy. Also the character type as a string so it would display the whole thing although learning how to use chars would be more beneficial :). I also put a system("pause") in your code so it wouldn't exit straight away and you could see the last info screen.
 
Oh awesome thanks, Your program worked perfectly. Thank you, now i have an up to date foundation to build from and refer back to. I do not know why this professor uses such an old book with stdafx.h I will have to tell him. Reminds me of my Unix professor who had all of us download Red Hat 9 HAHA, like we're on 486 machines. Its 2006... Ugh Community College..
 
Status
Not open for further replies.
Back
Top Bottom