Hi to all,
Hope you all will be fine. I am new to C++. Although i have read the basics but i am a newbie to C++.
Now i want to learn how to use class in C++. For this i made a simple class, assign variables and simply try to assign values to variables. But i got errors

I wrote very simple code

Code:
class Test {
public:
    Test(char* firstNamePointer, char lastName[]);
    Test(const Test& orig);
    virtual ~Test();

    int item;
    char *firstNamePointer;
    char lastName[10];
   
   // string middleName;

private:

};

Test::Test(char* firstNamePointer, char lastName[]) {

    this->firstNamePointer = firstNamePointer;
    this->lastName = "Mahmood";
    //this->lastName = lastName;
}

Test::Test(const Test& orig) {
}

Test::~Test() {
}

int main(int argc, char** argv) {

    Test *test = new Test("Basit", "Mahmood");
    test->item = 5;
   
    //test->middleName = "Ahmed"

    cout << (*test).item << endl;      //ok
    cout << test->item << endl;        //ok

    cout << endl;
    cout << (*test).firstNamePointer << endl;      //ok
    cout << test->firstNamePointer << endl;        //ok

    cout << endl;
    cout << (*test).lastName << endl;
    cout << test->lastName << endl;

    return (EXIT_SUCCESS);
}
Error that i got in the case

Code:
Test::Test(char* firstNamePointer, char lastName[]) {

    this->firstNamePointer = firstNamePointer;
    this->lastName = "Mahmood";                        //error
}
is

Test.cpp:13: error: incompatible types in assignment of `const char[8]' to `char[10]'
and when i use this code

Code:
Test::Test(char* firstNamePointer, char lastName[]) {

    this->firstNamePointer = firstNamePointer;
    this->lastName = lastName;                             //error
}
then the error is

Test.cpp:14: error: incompatible types in assignment of `char*' to `char[10]'
Also when i try to use string in my code like this

Code:
#include <string.h>  //also try <string> and <strings.h>

class Test {
public:
    Test(char* firstNamePointer, char lastName[]);
    Test(const Test& orig);
    virtual ~Test();

    int item;
    char *firstNamePointer;
    char lastName[10];
   // char lastName[10] = "Ahmed";
    string middleName;                        //Unable to resolve identifier string

private:

};
why it saying unresolved identifier string even i am including file <string.h>.
How can i use string in my class.

Please tell what i am doing wrong

thanks