online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <cmath> using std::sqrt; using std::atan; #include <iostream> using std::cout; using std::endl; template <class T> class rectangular { public: T xco,yco; rectangular():xco(0),yco(0){} rectangular(T x,T y):xco(x),yco(y){} void display_rect() { cout<<"rectangular coordintaes: "<<xco<<","<<yco<<"\n"; } }; template <class S> class polar { S radius,angle; public: polar():radius(0),angle(0){} polar(rectangular<S> r) { radius=sqrt(r.xco*r.xco+r.yco*r.yco); angle=atan(r.yco/r.xco); } void display_polar() { cout<<"polar coordinates: "<<radius<<","<<angle<<"\n"; } }; int main() { cout<<"Before conversion\n"; rectangular <double> r(4.71,30.56); r.display_rect(); cout<<"After conversion\n"; polar<double> p(r); p.display_polar(); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue