I'm failry new to C++ programming, and I'm at the point where I'm starting to learn classes. I'm using C++ for Dummies and various online tutorials, and I was trying to make a very basic program utilizing a class, since a lot of the examples I'm finding are fairly compplex (at least for me right now).
Basically, I'm trying to prompt the user to enter their first and last name, then get them displayed both together, using a class. I know how this could be done using just arrays or strings and displaying each name separately, but it's my understanding that by using a class, you can sort of consolidate the info. If you could steer me in the right direction, I'd really appreciate it - this code is getting all kinds of compile errors.


Code:
#include <stdlib.h>
#include <iostream.h>
using namespace std;

class testClass
{
     public:
           char firstName[10];
           char lastName[12];
};

int main()
{
      testClass tc;
      cout << "Enter your first name:\n";
      cin >> tc.firstName;
      cout << "Enter your last name:\n";
      cin >> tc.lastName;
      cout << "Here's what you entered:\n";
      cout << tc;

      cin.ignore();
      cin.get();
      return 0;
}

Also, I know if I wanted to, I could simply put


Code:
cout << tc.firstName << tc.lastName;

and that would display the first and last name, but aren't you supposed to be able to display all components of a class with just one command? I thought that was the magic of a class.