Suppose I have a data member for a struct which is a pointer to char
Code:struct Sample { char* sPtr; // more code......... }; int main() { // Now how do you dynamically allocate a string for char* ?? // My try // Sample a; // a.sPtr = new char "Hello World!"; // but this doesnt works whats the correct syntax ? return 0; }