I need some really basic help

Started by
4 comments, last by Rodan 18 years, 10 months ago
I will say it for all of you so that we can get it out of the way...I don't know much about programing in C/C++ and I can look like an idiot because of my inexperience. With that said... Can some one explain to me what the following are and how they are supposed to be used: Classes Vectors #include files (I know they are headers and that they are basicly a way of including a whole bunch of very basic tools predefined by the compiler...but how do I know what are in them and what they are supposed to be used for...when do I use what?) Object Oriented Programing (I thought I knew about this, but I think after I have seen some of the code that is out there that I may not fully understand this the way it is supposed to be understood.) What code do I use when...system("CLS"); or clrscr(); Is there a list of all of the comands for C and C++ that I just have not found? Help GameDev.net...you're my only hope...snooge.
Advertisement
Quote:Original post by Rodan
I will say it for all of you so that we can get it out of the way...I don't know much about programing in C/C++ and I can look like an idiot because of my inexperience. With that said...

Can some one explain to me what the following are and how they are supposed to be used:

Classes
That's kind of complicated. There is a description here which might help.
Quote:Vectors
Vectors (assuming you mean std::vector, not vectors in mathematics) are dynamically sized arrays. Meaning it can be resized at runtime.

Quote:#include files (I know they are headers and that they are basicly a way of including a whole bunch of very basic tools predefined by the compiler...but how do I know what are in them and what they are supposed to be used for...when do I use what?)
[google] it! There's some information on organizing files into headers here.
Quote:Object Oriented Programing (I thought I knew about this, but I think after I have seen some of the code that is out there that I may not fully understand this the way it is supposed to be understood.)
Basically, it means combining operations and the data it operates on into abstractions called "objects." (Probably a better (and more detailed) description here).
Quote:What code do I use when...system("CLS"); or clrscr(); Is there a list of all of the comands for C and C++ that I just have not found?
Not sure exactly what you mean, but system() executes commands in whatever shell you're using (in DOS, if you're using Windows).
Hey, we all had to start somewhere, but there are entire books devoted to providing the answers to your questions. If you haven't already, I'd suggest looking here and reading the beginners forum FAQ.

Consider buying some introductory programming books and working through them. Classes and vectors are such large topics that it's just not possible to do them justice in a forum post.

Programming is not for everyone, generally what you do is read, read, and then read some more, but if you can keep up with it it's pretty rewarding.
i would reccommend www.cprogramming.com

and for books, i just got done reading SAMS teach your self c++ in 24 hours.

Excellent book imo. I had programming experience before, but not much. I got through the topics of classes, mutli-dimensional vectors (or arrays w/e u prefer), function overloading, inheritance and polymorphism, pre processor commands, object oriented program design, error handling in just 3 days, and I have a pretty good grasp on all of the above mentioned topics. Great book. Pointers and linked lists i kinda skimmed through, but the basic theory behind them I do understand, should I need to ever use them it wont be too hard, just take a quick peek at the correct syntax and maybe refresh my self on the topic.
You could look at some beginners tutorials like the ones found at Cprogramming.com.

[edit]
Oops, looks like Fixxer beat me to it [smile].
[/edit]
--Brice Lambson
OH MY GOD!!! I just checked out cprogramming.com and I am enthrawled <BIG, BIG, BIG, BIG, HUGE SMILE!!!> Thank you both very much for suggestion that. I think that is exactly what I have been looking for.

Thank everyone else who has added their suggestions too. I am going to see if I can answer my own question a little and maybe someone can tell me if I am close.

Classes/objects are basicly anything in C++ that can be defined in a seperate location and in a cookie cutter sort of basic format. You can put instances of these together with various functions and come up with workable code. The way it was described to me (2 pages later in the book I was reading...damn impaticent me...lol) was this:

Imagine a plate of nachos as a completed program. To get to that point you need several object like chips, a plate, cheese, meat, peppers and a microwave. All that needs to be worried about when coding the over all nachos is put the chips on the plate, the meat on the chips, the cheese on the meat, the peppers on the cheese then all of it in the microwave. You don't have to re-invinte the microwave or build one that only cooks nachos, etc. That is an instance of Class Microwave (sub class of Oven, sub class of Kitchen Appliance, sub class of Household Item, sub class of...well, you get the point...lol).

After reading that, I think I see 2 things that were causing me issues. I was thinking in a functional programing style instead of an object oriented style. In other words, I was following what the program did and trying to add in individual pieces of the object in a happhazard way. When everything started talking about objects and classes and such I had no clue what they meant beacuse I was not looking at it from the right perspective.

Vectors I think I understand (if you are saying they are just arrays). I say I think because I see how to make them but I am not 100% on when I would use them. I am starting to see it now in the whole, "I could almost see it." "Congradulations, you have just taken your first step into a much larger world."

My 2nd issue was just good old fashioned not waiting for the answer but instead wanting everything now. Just like my first idea for a program was an MMORPG that was a combat flight sim with ground fighting and enemy AI on the level of the Agents in the Matrix...but I would never reach too far...lol.

Thank you all again, and I will try to keep the stupid questions to a minimum in the future.

This topic is closed to new replies.

Advertisement