online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<stdio.h> #include<string.h> int main() { FILE *fp; char str[20] = "Welcome to India"; char buf[20]; //fwrite example fp = fopen("file2.bin","w+"); if(fp == NULL) { printf("fopen error\n"); return -1; } fwrite(str,strlen(str)+1, 1, fp); fseek(fp, 0, SEEK_SET); fread(buf, strlen(str)+1, 1, fp); printf("%s \n", buf); fclose(fp); return 0; }
Welcome to India

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