Hello, I'm using NetBeans 6.9 on GNU/Linux (Ubuntu 10.10)
When I run this,
Code:
#include <iostream>;
using namespace std;
void showname();
void showage();
int main(){
showname();
showage();
return 0;
}
void showname(){
int name;
cout << "What is your name?" << endl;
cin >> name;
cout << "Your name is " << name << endl;
}
void showage(){
int age;
cout << "What age are you?" << endl;
cin >> age;
cout << "You are " << age << " years old." << endl;
}
..all I get is..
"Your name is 0
What age are you?
You are 0 years old."
when I enter my name. Please help (It should be obvious what output I'm expecting to get)