online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXUSERNAME 30 #define MAXPASSWORD 20 typedef struct { char username[MAXUSERNAME]; char password[MAXPASSWORD]; } pass; int main() { char userName[MAXUSERNAME]; char password[MAXPASSWORD]; pass t; int c; FILE *P= fopen("teachers.txt", "rb"); if (P == NULL) { printf("Error! opening file"); exit(1); } do { printf("\nUsername:"); fgets(userName,MAXUSERNAME,stdin); printf("\nPassword:"); fgets(password,MAXPASSWORD,stdin); if((!strcmp(userName, t.username)) && (!strcmp(password, t.password))) { printf("Welcome to the Ahjin Private Primary School Repot Renerating System"); } else { printf("\nLogin Failed \nEnter Username & Password Again\n"); c++; } } while(c<=3); if(c>3) { printf("Login Failed"); printf("Sorry,Unknown User."); } }
teacher1,password teacher2,password teacher3,password teacher4,password teacher5,password

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