I'm tying to make some sense of this pointer capability but after two nights of reading and playing with examples I just can't seem to get this to work.
This code element is a small part of a bigger program I'm designing and to simplify the coding I'm trying to pass a pointer through a function to manipulate variable defined and set up in a typedef struct.
However I keep bashing my head against compile errors so I'm reaching out to those that know - I'm still quite new at this....
would you believe it, just as I posted this I saw the message next door on classes and though 'that might be interesting'.
Saw a very similar example..
I put :: before pindef_ in the function variable to and bingo, complied and works....
Given that this is C++, and not C, you can completely drop the 'typedef' before the 'struct'.
Additionally symbols of global scope should be prepended with the global scope resolution operator '::,' but all that is a little much for the beginner.
I have modified the sketch for the typedef change and that complies and runs fine but the function will only compile if I put the :: in front of pindef_
I understand this is to access a global definition but am I missing something here as I don't understand why I need it only here to work and I'd like to avoid prefixing everything with :: as in your reply