online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//Pasar una estructura a una funcion //Agregamos una funcion que use la estructura Point //de manera que se pueda construir un segundo punto: #include <iostream> using namespace std; struct Point{ public: double x, y; }; struct Vector{ public: Point start, end; }; // Pasando por valor void variacion_v(Point p, double dx, double dy){ p.x += dx; p.y += dy; } // Pasando por referencia void variacion_r(Point &p, double dx, double dy){ p.x += dx; p.y += dy; } int main(){ Point p; p.x = 1.0; p.y = 2.0; variacion_v(p, 3.0, 4.0); cout<<"p("<<p.x<<","<<p.y<<")"<<endl; // no cambia (1,2) variacion_r(p, 3.0, 4.0); cout<<"p("<<p.x<<","<<p.y<<")"<<endl; // funciona (4,6) return 0; }

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