C++: Initializing chars array and int in class constructor
<p>I am trying to find a guide and even found <a href="http://stackoverflow.com/questions/5602030/how-can-i-use-member-initialization-list-to-initialize-it">this</a>, but it didn't provide an answer.
My question is how to initialize a C array in a constructor? Below I put a hypothetical example of what I think of doing, however I have no clue of whether it is ok but faulty, perfect, or simply there is something wrong and there would be a way to make it better.</p>

<pre><code>class A{
private:
    char* a;
    int b;
public:
    A(char*, int);
}

A::A(char* _a, int _b){
    strcpy(a, _a);
    b = _b
}

int main(){
    A tempA;
    char arr[50];
    int c = 40;

    strcpy(arr,"derp")
    tempA = new A(arr,c)

    return 0;
}
</code></pre>

<p>I have no C++ expert close to me at the moment so I would appreciate to receive as much feedback as possible. Also sorry if this is a duplicate question, but I really found nothing on this out there.</p>
