Help With Array Program

Ok, so I am working on an assignment for my Intro to C++ Class. The instructions are: "Write C++ program that uses an array of characters to input and output your address (you can use a fictional address)"

My question is am I supposed to code my address in the program, so when it is executed it just outputs the address. Or am I supposed to code the program to ask the user to input the address when the program is actually being run, and then output it.


Any help will be much appreciated.
This is my code, does this make any sense? anybody?

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
using namespace std;
int main()
{
char address1[40];
cout << "Enter your home address, street name, city, state, area code "<< endl;
cin.getline(address1,40,'\n');
cout <<"You entered "<< address1 << endl;
 system("pause");
 return 0;
}
I think it satisfies the assignment.:)
Last edited on
im just confused with the part of the assignment that says (you can use a fictional address) because I am not actually outputting an address in the program, since it asks the user to input the address.
Topic archived. No new replies allowed.