The following code works fine in Dev C++ but when I am running in turbo C I am not getting any output. I already have data stored in users.bin file.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#define MAX_LIMIT 50
struct User {
char userName[20];
char password[20];
float accountBalance;
short int failedAttempts;
char status; //---------- l for locked account and u for non-locked account
}user[MAX_LIMIT];
FILE* fp;
void main()
{
short int userCode;
char uName[10];
//will read the available user information from users.bin file
fp=fopen("users.bin","rb");
fread(user,sizeof(struct User),MAX_LIMIT,fp);
printf("%s",user[1].userName);
}