online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; void square(int *n, int num); int main() { int i, nums[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; cout << "Original array values: "; for(i = 0; i < 10; i++) cout << nums[i] << " "; cout << endl; square(nums, 10); cout << "Altered array values: "; for(i = 0; i < 10; i++) cout << nums[i] << " "; cout << endl << endl; //system("pause"); return 0; } void square(int *n, int num) { cout << "before loop, num=" << num << ", n=" << n << endl; while(num) { cout << "inside loop, num=" << num << ", n=" << n << ", *n=" << *n; *n = *n * *n; cout << ", *n2=" << *n << endl; num--; n++; } cout << "after loop, num=" << num << ", n=" << n << endl; }

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