This small program exhibits the problem that I am having.
I have a pointer to a struct, which I want to initilise (new) in a function.
It compiles okay - and runs, but crashes at the 'cout'. Running in Debug you can see that after the call to tryToInitialiseArray, myStruct_ is still NULL.
I guess this is because the myStruct_ is being passed by copy (not as a pointer or reference) - but I don't understand why.
Can anybody help?
(I have also tried it without the 'struct" in the function definition, with the same results.
Bookmarks