Hi im creating a linked list with these data types
etc
int account_number
char firstName[10]
char lastName[10]
float total_Balance
would anyone give a simple instruction to input/output these. i have tried everything but still doesnt work so far i have done this.
#include<iostream>
using namespace std;
struct account_query
{
int account_number;
char firstName[10];
char lastName[10];
float total_Balance;
};
struct link
{
account_query data;
link * next;
};
class Records
{
private:
link * first;
public:
Records( )
{ first = NULL; }
void write_rec( );
};
///////////////////////////////
void Records::write_rec()
{
link *newlink;
newlink=new link;
cout<<"please enter account_number";
cin>>newlink->link->data->account_query->account_number; //problem
cout<<"please enter firstName";
cin>>newlink->firstName; //problem
cout<<"please enter lastName";
cin>>newlink->lastName; //problem
cout<<"please enter total_Balance";
cin>>newlink->total_Balance; //problem
newlink->next = first;
first = newlink;
}
/////////////////////////////////////////////////////////
void main()
{
Records s;
while(true)
{s.write_rec();}
system("pause");
}