I am writing a program that should merge two files, sort and update one of the files, and output the results to several different files. I have the following code trimmed down to one error:"Entry point must be defined" and i cannot figure out what is going wrong:
#include<iostream>
#include<string>
#include<fstream>
#include<cstdlib>
#include<iomanip>
#include <cctype>
using namespace std;
int main();
struct
cust_record{
char
Trans_type;
string Cust_ID;
string LName;
string FName;
double
Balance;
int
Credit_limit;
char
Status;};
struct
master_record{
string Cust_ID;
string LName;
string FName;
double
Balance;
int
Credit_limit;
char
Status;};
bool
cust_ID_validator(string str1){
bool
flag;
if
(str1.length() != 7) flag = false;
else
if(!isdigit (str1.at
(0))) flag = false;
else
if(!isdigit (str1.at
(1)))flag = false;
else
if(!isdigit (str1.at
(2))) flag = false;
else
if(!isalpha (str1.at
(3))) flag = false;
else
if(!isdigit (str1.at
(4))) flag = false;
else
if(!isdigit (str1.at
(5))) flag = false;
else
if(!isdigit (str1.at
(6)))flag = false;
else
flag =
true;
return
flag;}
istream&
operator >> (istream& IS, cust_record& what) {
Problem is you don't even have a main defined, hard to tell with messy code like that, so I cleaned it up.
It would probably help you a lot in the future if you tried to style your code similar to this