+ 3

This is not working in play ground but working in turbo c++ why??

#include <iostream.h> #include <conio.h> class point_3d { int x,y,z; public: point_3d (int x1,int y1,int z1) { x=x1,y=y1,z=z1; } point_3d operator +(point_3d p) { point_3d temp; temp.x=x+p.x; temp.y=y+p.y; temp.z=z+p.z; return temp; } void show() { cout<<x<<y<<z<<endl; } }; void main() { point_3d p1(1,2,3),p2(5,4,3),p3; p1.show(); p2.show(); getch(); }

25th Apr 2017, 5:57 AM
Sahil Sharma
Sahil Sharma - avatar
2 Respuestas
+ 2
txc
25th Apr 2017, 6:08 AM
Sahil Sharma
Sahil Sharma - avatar
+ 15
Because Turbo C++ has syntax which is no longer supported in later versions of the C++ standard, i.e. Turbo C++ is growing obsolete. Some difference include: - Main function must be int and returns 0 at the end of your program. - Header files such as <iostream.h> has been renamed to <iostream> . Please look into this thread: https://www.sololearn.com/Discuss/288609/?ref=app '
25th Apr 2017, 6:03 AM
Hatsy Rei
Hatsy Rei - avatar