• (3 Pages)
  • +
  • 1
  • 2
  • 3

Object Oriented Programming (oop) Tutorial Explains the basics of OOP. [Part-I] Rate Topic: ****- 4 Votes

#16 Xing  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 19
  • View blog
  • Posts: 725
  • Joined: 22-July 06

Posted 16 November 2006 - 08:24 AM

Didn't read the whole tutorial just scanned it fast. One thing which immidietly struck me was about the size of integer.

sizeof integer or any other built-in type is implementation defined in C and C++. Standard has only specified their minimum sizes

Base type	Minimum size (bits)	Minimum value (signed)	Maximum value (signed)	Maximum value (unsigned)
char			8					 -127					127					   255
short		   16					-32,767				 32,767	   			 65,535
int			 16					-32,767				 32,767					65,535
long			32					-2,147,483,647		  2,147,483,647			 4,294,967,295



Was This Post Helpful? 0
  • +
  • -

#17 Oblivion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 28-November 06

Posted 29 November 2006 - 07:06 AM

Thanks, this looks good. :)
Was This Post Helpful? 0
  • +
  • -

#18 lapastica  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-December 06

Posted 09 December 2006 - 10:01 AM

great tutorial..thx
Was This Post Helpful? 0
  • +
  • -

#19 zorro68  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-January 07

Posted 15 January 2007 - 02:22 PM

I'm trying to know how works OOP and i think this tutorial is very good. But i can see you have some math mistakes in this tutorial, we see:

When you multiply two complex number, you say:
imag=(a.real * b.imag) - (a.imag * b.real);
and is:
imag=(a.real * b.imag) + (a.imag * b.real);

And when you divide complex numbers, you say:
float div = (....) + ( ....)
and is:
float div = (....) - ( ....)

So the output change:
...
Real=-5.47
Imaginary=7.92
...

and is:
...
Real=-9.24
Imaginary=11.88
...

You must change this in some functions when multiply and divide complex number.

I'm waiting for the next tutorial...

PD: Sorry for my bad english.

This post has been edited by zorro68: 15 January 2007 - 02:26 PM

Was This Post Helpful? 0
  • +
  • -

#20 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Posted 16 January 2007 - 07:39 AM

Thanks for correcting the errors
:)
Was This Post Helpful? 0
  • +
  • -

#21 Zammy  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 21-October 06

Posted 24 January 2007 - 01:31 PM

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.

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



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

 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.
Was This Post Helpful? 0
  • +
  • -

#22 PrettyHateMachine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 26-April 07

Posted 19 May 2007 - 07:28 PM

View Postborn2c0de, on 21 Dec, 2004 - 03:02 AM, said:

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:
Was This Post Helpful? 0
  • +
  • -

#23 priyanth kumar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-February 08

Posted 03 February 2008 - 08:17 AM

View Postvirendra, on 12 Sep, 2006 - 09:16 PM, said:

where is the second part still waiting for it
virendra :rolleyes:

Was This Post Helpful? 0
  • +
  • -

#24 circuspeanuts  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 224
  • Joined: 11-April 08

Posted 28 July 2008 - 07:58 AM

:lol:

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..)?
Was This Post Helpful? 0
  • +
  • -

#25 tearher33  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-May 09

Posted 28 May 2009 - 02:06 AM

View PostPrettyHateMachine, on 19 May, 2007 - 06:28 PM, said:

View Postborn2c0de, on 21 Dec, 2004 - 03:02 AM, said:

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:


-tearher33

Quote

When will be the 2nd part will be posted??hehehe
:) i'm waiting for it!!!

Was This Post Helpful? 0
  • +
  • -

#26 Indrajeet777  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-June 09

Posted 09 June 2009 - 10:37 PM

View Postborn2c0de, on 13 Jan, 2005 - 08:54 AM, said:

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
Was This Post Helpful? 0
  • +
  • -

#27 halihali  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 15-May 09

Posted 26 June 2009 - 12:11 AM

i read document OOP and i don't understand place about operation, i wrote :
#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.
Was This Post Helpful? 0
  • +
  • -

#28 Guest_venkatakrishna*


Reputation:

Posted 11 June 2010 - 02:14 AM

View Postborn2c0de, on 21 December 2004 - 02:02 AM, said:

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

Was This Post Helpful? 0

#29 NicholasIT  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 24-April 10

Posted 18 July 2010 - 07:19 PM

nice tutorial =D
Was This Post Helpful? 0
  • +
  • -

#30 shaikh_siraj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 21-July 10

Posted 21 July 2010 - 02:09 AM

Not able to view the tutorial. Can anybody please assist on steps on how i can watch this tutorial?



View Postborn2c0de, on 21 December 2004 - 02:02 AM, said:

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

Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3