Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 11-28-2006, 04:23 AM   #11 (permalink)
baronvongogo's Avatar
 
Master Techie

Join Date: May 2005

Location: UK

Posts: 2,749

baronvongogo is on a distinguished road

Default

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.
__________________
baronvongogo is offline  
Old 11-28-2006, 11:33 AM   #12 (permalink)
 
Newb Techie

Join Date: Jun 2005

Posts: 35

mrserv0n

Send a message via AIM to mrserv0n
Default

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..
mrserv0n is offline  
Old 11-28-2006, 11:47 AM   #13 (permalink)
baronvongogo's Avatar
 
Master Techie

Join Date: May 2005

Location: UK

Posts: 2,749

baronvongogo is on a distinguished road

Default

no problem, and Id try to learn using chars instead of strings both of them have headaches though.

if you need any other help you now know where to come
__________________
baronvongogo is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On