hey im having troubles with my Oject Oriented programming. this data structures thing is reaking havok on my brain. Making struc and classes. anyone know?
|
What do you want to know? How to initialise structs? How to use them generally? I've not done C++ in about 6 months, but I might be able to help. Its not too hard. Java programming is heaps easier though.
|
i know how to intialize a class and define the private and public members. Im having a problem with the "using namespace std: and also using macroguards. You have to write a the Function prototype in the header file and the function implementation in the cpp extension. so i dont know how to call the the header file. i know u gotta use # include "throttle.h" for example but using namespace how do u do it?? :squint:
|
|
This might also help http://www.4p8.com/eric.brasseur/cppcen.html I can't give you an exact answer sorry.
|
thanks i appreciate it alot
|
using namespace whatever is just a way of keeping all your nifty classes seperated from someone elses. So if I created a class called "PhinsupIsCool" and you decided to create one as well you could still have them both in the same program just seperated by namespace.
std is the Standard Templates Library and gives you access to a bunch of stuff that is commonly done in C and C++. For example cout outputs a string, there's a function to convert things toString and so on. Without it you'd have to manually code all that crap. Not fun. Name your headers after your class you'll be happier that way. Inclusion guards or macro gards make my head hurt. Function prototypes are simply in the header as you note. Put them in order. Trust me. Otherwise OOP takes a bit of getting used to in terms of how you think about coding and what not. |
thankz
|
All times are GMT -5. The time now is 10:18 AM. |
© 2024 MH Sub I, LLC dba Internet Brands