Am trying to extract a string of characters and numbers from a text file into two different data types in a linked list...i.e the if the text file has the data
myname 100
i want the "myname" to be stored as a string and then the 100 as an integer..can anyone help with an idea of how to do it?? so far i can only the whole string..thanx
for(i=0;i<3;i++)
{
getline(infile,name_in);
tmp = new myStruct;
tmp -> name = name_in;
tmp ->link=head;
head=tmp;
}
here is the struct definition
struct myStruct
{
string name;
int number;
myStruct* link;
};
typedef myStruct* nodePtr;