Hi everyone!
In this struct sentence:
struct PlayerInfo {
int normal_view[5];
int idle_view[5];
int enabled_icon;
int disabled_icon;
bool added;
Button * button;
Character *character;
};
what's the difference between:
Button * button;
Button* button;
Button *button;
relative to the position of the asterisk??
The game still compiles, and works perfectly, no matter what position the asterisk is in.
Thanks in advanced!!
As you found out the position doesn't matter, the script parser doesn't care about the spaces. You can even do Button*button; without any space.
I put the asterisk right after the pointer type because I'm a) declaring pointers b) might declare multiple ones.
I.e.
Button* b1, b2, b3;
declares three Button pointers, all of which would require an asterisk if I declared them in individual lines, so putting it at the start makes sense as opposed to Button *b1, b2, b3;
The asterisk is part of the type if you will so that's where it goes in my book.
Thank you very much!!!!!
(SOLVED)
You don't actually need to write the topic title in all-caps. It looks like you're shouting.
Quote from: Snarky on Wed 29/03/2023 15:01:57You don't actually need to write the topic title in all-caps. It looks like you're shouting.
(Sorry, it's a strange habit I'll take in count from now on in order to avoid it!! Thanks)