C++ School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a C++ Expert!

Join 307,150 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,694 people online right now. Registration is fast and FREE... Join Now!




Object Oriented Programming (oop) Tutorial

2 Pages V < 1 2  
Reply to this topicStart new topic

> Object Oriented Programming (oop) Tutorial, Explains the basics of OOP. [Part-I]

Rating  3
Zammy
*



post 24 Jan, 2007 - 12:31 PM
Post #21
Very nice tutorial. I hope we see a second part soon because its kinda short. Some of the stuff in the code are not throughly explained.

CODE
   complex(float r=0.0f,float i=0.0f)
           {
                real = r;
              imag = i;
           }


What does the ".0f" do in declaring the function?

CODE
friend ostream& operator <<(ostream& s,complex c);
Not explained. Waiting for 2nd chapter?

Question: How important is Overloading Operators ? It looks too much fuzz for readability.

Despite the above KUDOS! I was pretty much suffering under the text book I was reading about OO. I am taking "Fundamental Data Structures" course that threw me in deep water from first 2-3 lectures. Now I have a homework for Sunday I am not sure if I be able to do.
Go to the top of the page
+Quote Post

PrettyHateMachine
*



post 19 May, 2007 - 06:28 PM
Post #22
QUOTE(born2c0de @ 21 Dec, 2004 - 03:02 AM) *

This Tutorial teaches you Object Oriented Programming from scratch. It is supposed to teach Inheritance as well but it is incomplete as of now. But the tutorial teaches you so many other things before you need to know Inheritance that by the time you finish reading it, the other half will be complete.

-Sanchit

Well done! This is great for me because im already familiar with java and was a little hazy on the syntactical differences between the two languages. Thanks pirate.gif
Go to the top of the page
+Quote Post

priyanth kumar
*



post 3 Feb, 2008 - 07:17 AM
Post #23
QUOTE(virendra @ 12 Sep, 2006 - 09:16 PM) *

where is the second part still waiting for it
virendra rolleyes.gif

Go to the top of the page
+Quote Post

circuspeanuts
**



post 28 Jul, 2008 - 06:58 AM
Post #24
laugh.gif

ironically enough, the one part I need really bad right now isn't in here xD

This tutorial has helped me lots, as well as some of your (and others) tutorials. I've come to better understand pointers, strings, implementing functions, and the arrow operator (->).

The only thing I'm missing at the moment is the inheritance portion so I may complete my final project. You wouldn't happen to have finished or know someone who may have an inheritance tutorial finished, would you (I only ask because I know you've probably been busy and haven't been able to finish Part II of the oop tutorial for inheritance and such..)?
Go to the top of the page
+Quote Post

tearher33
*



post 28 May, 2009 - 01:06 AM
Post #25
QUOTE(PrettyHateMachine @ 19 May, 2007 - 06:28 PM) *

QUOTE(born2c0de @ 21 Dec, 2004 - 03:02 AM) *

This Tutorial teaches you Object Oriented Programming from scratch. It is supposed to teach Inheritance as well but it is incomplete as of now. But the tutorial teaches you so many other things before you need to know Inheritance that by the time you finish reading it, the other half will be complete.

-Sanchit

Well done! This is great for me because im already familiar with java and was a little hazy on the syntactical differences between the two languages. Thanks pirate.gif


-tearher33
QUOTE

When will be the 2nd part will be posted??hehehe
smile.gif i'm waiting for it!!!
Go to the top of the page
+Quote Post

Indrajeet777
*



post 9 Jun, 2009 - 09:37 PM
Post #26
QUOTE(born2c0de @ 13 Jan, 2005 - 08:54 AM) *

I decided to make this Tutorial Complete in itself. Hence I shall name it OOP Tutorial in C++ PART 1.
PART 2 will contain Inheritance and a few advanced concepts of OOP.
Here's the PART-1 Version of the Tutorial.


Hi nice work you are really born2 code.It reallly help me.....
When you are going two complete PART-2 Version of the Tutorial...
Please let me know awaiting for your reply
Go to the top of the page
+Quote Post

halihali
*



post 25 Jun, 2009 - 11:11 PM
Post #27
i read document OOP and i don't understand place about operation, i wrote :
CODE

#include<conio.h>
#include<iostream.h>
class complex
{
   private:
      float real;
      float imag;

   public:
      complex(float r=0.0,float i=0.0)
      {
          real=r;
        imag=i;
      }
      // Other Functions
      friend ostream& operator <<(ostream& s,complex c);
      friend istream& operator >>(istream& t,complex d);
};

ostream& operator <<(ostream &s,complex c)
{
   s<<"Real = "<<c.real<<endl
    <<"Imaginary = "<<c.imag<<endl;
   return s;
}
istream& operator >>(istream& t,complex d)
{
          cout<<"Input Real and imag: ";
          t>>d.real >>d.imag;
}

int main()
{
   complex a;
   cin>>a;
   cout<<a;
   getch();
   return 0;
}


Output:
Input Real and Imag: 2.3 3.4
-> Real: 0
-> Imag: 0

i don't understand here, can you help me about it.
Why it out 0 0.
Go to the top of the page
+Quote Post


2 Pages V < 1 2
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/21/09 04:34PM

Live C++ Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month