Stating a char

I am programming a small game for my D of E skills section. I am doing some practice text and I have done, so far, this.
// Star Fighter Mini - Lite
// Author : Joe Rowan
// Date Started : 15 / December / 2012
// Date Completed :

#include <iostream>
using namespace std;

intmain()
{

int time, speed
char shipname

cout << "Enter ships name: " << shipname << endl;
cin >> shipname;

cout << "Enter ship's average speed (meters per second): " << speed << endl;
cin >> speed;
cout << "Enter time the ship has been travelling (seconds): << time << endl;
cin >> time;

cout << "Ships average distance (meters): " << time * speed << endl;
cout << "shipname has met resistance!" << endl;
return 0

}


I want, on the near bottom of the code, when shipname is wrote after cout, to say the name entered at the start, how do I go about doing this? Any more mistakes I have made? If so, where wnd how? Thanks.
char only stores a single character, you need string.
Ok, so I need string? Ok, I thought char could hold 256 characters. Ok, so if I use string, how do I make cout state the string?
Ok, I thought char could hold 256 characters.

It can hold 256 different characters, but only one at a time.

Ok, so if I use string, how do I make cout state the string?
cout << shipname << endl;
Thanks, but one LAST question... how would I include text after that too? Would it be cout << shipname << " has met resistance!"
Yes. Just try it.
Topic archived. No new replies allowed.