-  [WT]  [Home] [Manage]

[Return]
Posting mode: Reply
Name
Email
Subject   (reply to 29)
Message
Captcha
File
Embed   Help
Password  (for post and file deletion)
  • Supported file types are: 7Z, GIF, JPG, PDF, PNG, RAR, TXT, XZ, ZIP
  • Maximum file size allowed is 10240 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 112 unique user posts. View catalog

  • Blotter updated: 2012-05-14 Show/Hide Show All

File 129981556475.jpg - (60.59KB , 372x496 , lolo.jpg ) Thumbnail displayed, click image for full size.
29 No. 29
ello /code/ today we went over a object oriented programming in C++ in my programming class and i got mind fucked because my teacher basically herped and derped and that was the lesson. i didn't really learn anything and I was wondering if any of you awesome guys could give me a quick tutorial on object oriented programming in C++, already tried google and the syntax makes 0 sense to me, if you have any websites or videos that'd be helpful or if we could get on an instant messenger program to show/write some code would be great, thanks in advance.

tldr; need help object oriented programming c++
Expand all images
>> No. 30
For online resources, try:
http://www.cprogramming.com/begin.html
http://www.learncpp.com/
http://www.cplusplus.com/doc/tutorial/

A pick you might want to pick up is "Teach Yourself C++ in 10 Minutes". Please note it will not actually teach you C++ in 10 minutes. It is, however, a handy little reference and can give you the basics of the language without bending your mind too much. Unfortunately, there are no exercises in it that will help reinforce the learning, but you should be doing that on your own anyway.

Good luck!
>> No. 31
File 130012999485.jpg - (305.31KB , 1264x769 , temple-waterfall-web.jpg ) Thumbnail displayed, click image for full size.
31
Awesome, I'll look at that when I get home. Thanks for the links and the speedy response. Is it possible to either torrent or buy the book online as an e-book or would I have to consume sunlight and go buy it IRL? Assuming that "pick' means book... I think c++ OOP has already bended my mind too much, Java was pretty straightforward but I think because the interface is a lot smoother than Dev C++...oh well, thanks a bunch
>> No. 32
Ugh. I wrote "pick" instead of "book". Great.

So, "C++ in 10 Minutes" came out before the ebook boom. You can order it online at Amazon and have it sent in if you don't want to go out for it. I just checked and if you buy it used, you'll get it very cheaply.

The book devotes three chapters to C++ Classes, two to Inheritance, and a couple more on Polymorphism (focusing on Virtual Functions). The second-to-last chapter is on Templates, but it's only a basic introduction,

That should be good for a start.

I'm curious - is there an exact part in C++ that's frustrating you? .
>> No. 35
Just the whole Object Oriented Programming, don't completely understand it and its vey frustrating. Currently, we have to write a person class then an employee class nested inside the person class and it's all rageworthy to me. Going to check out the book this weekend if I get the chance.
>> No. 36
Try these links. I haven't read through them completely, but they seem to try to break down the OO concept for beginners. Maybe they will work for you.

http://www.suite101.com/content/understanding-object-oriented-programming-a127536
http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/oop.html
http://www.codeproject.com/KB/architecture/OO.aspx

So for C++, this might be something like:

Class Person { .. }
// protected: int age; char * name; int gender;
// public: int getAge(); char * getName(); int getGender();

Class Employee : public Person { .. }
// private: char * employer; int yearsEmployed;
// public: char * getEmployer(); int getYearsEmployed();

The Person class is the blueprint for a generic person. It can be considered a small program in its own right because hit has data (name, age, gender), and methods that work on that data (getAge, getName, getGender).

The Employee class is an extension of the Person class, since employees are people, too. Because it's an extension of the Person class, it has access to all public and protected data and methods from the Person class, and adds its own data and methods. This reduces the need for duplicated effort - you only add what parts make the new class unique..

This is just a basic idea, but maybe it will help. Also, my command of C++ is very rusty, so hopefully the previous links and book will be more clear for you.

Good luck!
>> No. 38
File 130076594825.jpg - (96.79KB , 500x647 , 1300590022095.jpg ) Thumbnail displayed, click image for full size.
38
Awesome, thanks man, (Monday Night) going to read over the websites and hopefully be able to finish the project. I actually had it about 80% finished but then I hit save as and my main cpp went into source mode and deleted my code so I ragequit :/ but I'm putting the websites on my ipod and going to get a good read on tonight, thanks man, if you have skype or vent we could talk on about code that'd be legit sometimes. just lemme know, checking the thread every other day
>> No. 41
Sorry, been away for a bit. I don't have any Skype or VOIP stuff going on right now. Just check out the books and tutorials and you'll be fine. Good luck.


Delete post []
Password  
Report post
Reason  




Inter*Chan Imageboard Top List