online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<stdio.h> #include<stdlib.h> int main() { int n,i,*ptr; printf("Enter number of elements: "); scanf("%d",&n); //memory allocated using malloc ptr=(int*)malloc(n*sizeof(int)); if(ptr==NULL) { printf("Sorry! unable to allocate memory"); exit(0); } else { printf("Memory successfully allocated using malloc.\n"); printf("Enter elements of array: "); for(i=0;i<n;++i) { scanf("%d",ptr+i); } } free(ptr); 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