Search:
Forum
Beginners
increase value of a data member?
increase value of a data member?
Oct 4, 2011 at 11:14pm UTC
DocCeaser
(43)
Is it possible to do this with structs without making a new data member.
For example, lets say one data member in my struct is grades and I want to bump the grade up from 90 to a 91. Do I have to make a new data member to do that?
Oct 4, 2011 at 11:26pm UTC
Disch
(13742)
No. Just increment it:
myobject.grades++;
// increment the 'grades' member of your 'myobject' object
Oct 4, 2011 at 11:42pm UTC
DocCeaser
(43)
thanks
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs