I have a few questions regarding C++ as it is new to me.
Finally I have made the step after 7 years of Java programming to C++.
The thing is that Java made me a die hard OOP minded programmer (where I think C++ and I won't be the best friends because of that)
I am a bit confused about the C++ OOP methods (as it is 90% the same but the approach is different).
The thing I'm trying to achieve is to create a global struct array variable that I can call & adjust.
But on the return tmpSq; I get a few errors that I don't understand at all
Is the difference in OOP that big between Java and C++ that it's a profession on it's own? Or did I miss something?
There are several problems with that code, none of which have anything to do with OOP. Here are three of them:
* A name that is all capitals usually denotes a macro (which you should try to avoid, by the way), so CUSTOMVERTEX might confuse people.
* You probably want square to be an array of objects, not an array of pointers, and you probably shouldn't get used to using global variables.
* You can't return an array from a function in C++.
* `void main()' is not a valid prototype for main(). If you learned that from a book, throw the book away and get one that is less than 12 years old.
Here is a complete standard program that does similar things to what you were trying to do: #include <iostream>
This is just a portion of code, it's actually the basic of the whole concept.
And the book was 14 years old, wich I allready have thrown away.
I understand the logic of your code alvaro. It actually makes perfect sense now I look at it.
You give the variable to the function that will set the variable instead of calling a returning method. (If I get it right)
and the `void main()` was loosly written out of hand but you get the picture.
Thanks for correcting me and pointing me to a proper pathway.
Yours truly,