online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; void noNegatives(int *x); int main() { int x, y; int *p1; p1 = &x; *p1 = 99; cout << "x contains: " << x << endl; cout << "x contains: " << *p1 << endl; p1 = &y; *p1 = -300; int temp, *p2; p2 = &x; temp = *p1; *p1 = *p2; *p2 = temp; void noNegatives(int &x); void noNegatives(int &y); p2 = &x; cout << "x is: "<< *p2; p2 = &y; cout << " and y is: " << *p2; } /* end of function main() */ void noNegatives(int *x){ if (*x < 0 ) *x = 0; } // Your output should look exactly like this (the blanks should be replaced with the correct values): /* # 5: x contains: __ # 6: x contains: __ #13: x is: 0 and y is: 99 #17: The address of the first element is ____________ #18: The address of the second element is ____________ #20: The first element in a[] is __ and the second element in a[] is __ #22: Now, x contains: 99 and y contains: 0 #23: Now, a[0] contains: 0 and a[1] contains: 99 */

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