Help What is wrong with my program

I need to get this program running for a class for some reason its not working

include <iostream.h>

Main()
}
{
char name [bubba joe]
char Address [6481 lake michigan dr.]
char city,state,zip code [Allendale,Mi,49401]
char phone number [616-813-9679]
cout << "enter a name: ";
cout << "enter a Address: ";
cout << "enter a city,state,zip code: ";
cout << "enter a phone number: ";
cin.get ( Name, "bubba joe");
cin.get ( Address, "6481 lake michigan dr.");
cin.get ( city,state,zip code, "Allendale,Mi,49401");
cin.get ( phone number, "616-813-9679");
cout << "you entered " << name << '\n');
cout << "you entered " << Address << '\n');
cout << "you entered " << city,state,zip code << '\n');
cout << "you entered " << phone number << '\n');
return 0;
}
I want to fix this for you, I really do, but I can't stop looking at it going WTF???

Please, open your book up and look at a sample C++ example and see what's wrong with yours, we also have reference material here that you can look at.

Here is one specifically that you can start with. http://cplusplus.com/reference/iostream/

Also, use the [code][/code] tags to put your code in so it's easier to read.
Better use this code instead:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <cmath>
using namespace std;
int main(){
   string name;
   string address;
   string city;
   string state;
   int zipcode;
   int number;
   cout << "Enter your name: ";
   getline(cin, name);
   cout << "Enter your address: ";
   getline(cin, address);
   cout << "Enter the name of the city where you live: ";
   getline(cin, city);
   cout << "Enter the name of the state where you live: ";
   getline(cin, state);
   cout << "Enter your zipcode: ";
   cin >> zipcode;
   cout << "Enter your phone number: ";
   cin >> number;
   system("cls");
   cout << "Name: " << name << "\n";
   cout << "Address: " << address << "\n";
   cout << "City: " << city << "\n";
   cout << "State: " << state << "\n";
   cout << "Zipcode: " << zipcode << "\n";
   cout << "Phone Number: " << number << "\n\n";
   system("pause");
   return 0;
}


I know I should have put the code cin.get();, but it doesn't always work for all IDE's and Compilers.

Hope I helped!
Topic archived. No new replies allowed.