struct FILEKEY
{
long account_id;
long customer_id;
long product_id;
long bill_eff_dt;
};
struct TOTAL
{
long bill_qty;
double int_charge;
double final_charge;
double credit_charge;
};
struct FILE_ELEMENTS
{
FILEKEY key;
TOTAL total;
};
FILE_ELEMENTS elementFile;
void populateDataInBuffer ( ) {
ifstream inputfile;
int size = 50;
inputfile.open("firstFile.txt");
actually, I am failing in type casting here.
inputfile.getline( elementFile.key.account_id, size, "~" );
elementFile.key.account_id is long type where as first parameter of getline has to be char *.
I am not getting what could be easy way of convert long to char *.