help on my code

Started by
10 comments, last by Xrystal 17 years, 10 months ago
Moving to For Beginners.
Advertisement
Quote:Original post by jyk
Quote:Original post by Xrystal
with the function parameters being pointers (&name) you may find that using name->one and name->two will work better.
The arguments are references, not pointers, so the . syntax is correct.

@The OP: It looks like the problem may be access privilages; try making the member variables of 'enemy' public and see if that works.

Once you get it working, the next step is probably to revise the design to reflect OOP principals such as encapsulation (assuming that's what you're going for).



Thanks for that comment. To be honest I get the two items mixed up. I almost always use &varname when calling a function that has *varname in its declaration. I think I misread the OPs code in that light and apologise for the misunderstanding.

This topic is closed to new replies.

Advertisement