NoPistons -Mazda Rx7 & Rx8 Rotary Forum

NoPistons -Mazda Rx7 & Rx8 Rotary Forum (https://www.nopistons.com/)
-   Insert BS here (https://www.nopistons.com/insert-bs-here-12/)
-   -   Anyone Know How To Do C++ (https://www.nopistons.com/insert-bs-here-12/anyone-know-how-do-c-12039/)

ROTARYROCKET7 02-09-2003 10:42 PM

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?

drifter 02-09-2003 11:02 PM

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.

ROTARYROCKET7 02-09-2003 11:08 PM

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:

drifter 02-09-2003 11:16 PM

does this help?

http://www.research.att.com/~bs/bs_faq2.html

drifter 02-09-2003 11:20 PM

This might also help http://www.4p8.com/eric.brasseur/cppcen.html I can't give you an exact answer sorry.

ROTARYROCKET7 02-09-2003 11:23 PM

thanks i appreciate it alot

Rotarydragon 02-10-2003 10:59 PM

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.

ROTARYROCKET7 02-10-2003 11:50 PM

thankz


All times are GMT -5. The time now is 10:18 AM.


© 2024 MH Sub I, LLC dba Internet Brands