Nov 11, 2015 at 1:47am
1)
|
Cadena(char* c) : cad(c){}
|
2)
|
Cadena(const char* c) : cad(c){}
|
2) isn't possible, but why? in 1) you haven't "warranty" of not to modify the char* c parameter. is this supposition ok? Thanks a lot
PD:
if you need here you have the complete code:
1 2 3 4 5 6
|
class Cadena {
public:
Cadena(char* c) : cad(c){}
private:
char* cad;
};
|
Last edited on Nov 11, 2015 at 1:48am
Nov 11, 2015 at 9:45am
You can't assign a const char* to a char*. It you could the char* could modify the const char*.