Pages: 1 [2]   Go Down
Author Topic: How to use class-specific variables in a function?  (Read 1017 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I give up on this thread.

Oh, OK.

Quote
But can you even put a struct in a class?

Yes you can do that.

You can use "get" and "set" methods if you want to hide the struct from the user. I'm sorry, it isn't clear what you are doing. If you want to give up, fair enough. You may want to read a C++ tutorial to get the basics of using classes and structures.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah there is some misunderstanding I'm having about how a class works compared to a sketch (sort of in it's own terms I suppose) so I'll need to read up more on syntax cuz I'm missing something. And YES that would work too! I could create a private struct and then create method that (in English) returns the value of a value of the struct! That is the exactly the thing I was looking for in the first place! Thank you! See I just hadn't thought of that. I thought that if I had a struct in a class I'd have to somehow call an entry of the struct outside the class. But I see now if I use a method instead of directly trying to reach it I can keep it private and tucked away, which is the whole point of me trying to make this library!  smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can you post what you have? i cant figure it out plz help
Logged

Pages: 1 [2]   Go Up
Jump to: