online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i, n; char buf[20]; char name[20][80]; printf("Enter the number of students: "); fgets(buf, sizeof(buf), stdin); n = atoi(buf); for(i=0; i<n; i++) { printf("Enter student name #%d: ", i+1); fgets(name[i], 80, stdin); name[i][strlen(name[i])-1] = '\0'; /* overwrite the trailing \n */ } printf("\nThe names of the students are:\n"); for(i=0; i<n; i++) printf("name[%d] = \"%s\"\n", i, name[i]); 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