-
I have following code that work 100 percent fine. I am also aware, what is actually going behind the scene. how "new" works in that case.
struct ABC{ int data = 1234; }; ABC *obj = new ABC; cout << "obj->data";
-
The following code does not work it compiles correctly then crashed. no syntax or compile error.
struct ABC{ int data = 1234; }; ABC *obj; // please explain?? cout << "obj->data";
-
Following code also works fine and simple one.
struct ABC{ int data = 1234; }; ABC *obj, myobj; myObj = &obj; cout << "obj->data";
I am also aware, hows 3rd one is working. Please explain, why 2nd one is not working. Sorry for not making main() procedure.
Aucun commentaire:
Enregistrer un commentaire