Um... Okay I've never used getline()
Oh no!
Um, can anyone give me a reason as to why this doesn't work?
Code:
void add_node_at_end()
{ node *temp, *temp2; // Temporary pointers
// Reserve space for new node and fill it with data
temp = new node;
cout << "Please enter the name of the person: ";
getline(temp->name, 256);
cout << "Please enter the age of the person : ";
getline(temp->age, 256);
cout << "Please enter the height of the person : ";
getline(temp->height,256);
temp->nxt = NULL;
// Set up link to this node
if (start_ptr == NULL)
{ start_ptr = temp;
current = start_ptr;
}
else
{ temp2 = start_ptr;
// We know this is not NULL - list not empty!
while (temp2->nxt != NULL)
{ temp2 = temp2->nxt;
// Move to next link in chain
}
temp2->nxt = temp;
}
}
Here are the errors
Code:
------ Build started: Project: Blackjack, Configuration: Debug Win32 ------
Compiling...
Card_Game.cpp
c:\documents and settings\jcoleman\desktop\blackjack\blackjack\linked_list.h(22) : error C2784: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'char [256]'
c:\program files\microsoft visual studio 8\vc\include\string(528) : see declaration of 'std::getline'
c:\documents and settings\jcoleman\desktop\blackjack\blackjack\linked_list.h(22) : error C2780: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)' : expects 3 arguments - 2 provided
c:\program files\microsoft visual studio 8\vc\include\string(476) : see declaration of 'std::getline'
c:\documents and settings\jcoleman\desktop\blackjack\blackjack\linked_list.h(24) : error C2784: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'int'
c:\program files\microsoft visual studio 8\vc\include\string(528) : see declaration of 'std::getline'
c:\documents and settings\jcoleman\desktop\blackjack\blackjack\linked_list.h(24) : error C2780: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)' : expects 3 arguments - 2 provided
c:\program files\microsoft visual studio 8\vc\include\string(476) : see declaration of 'std::getline'
c:\documents and settings\jcoleman\desktop\blackjack\blackjack\linked_list.h(26) : error C2784: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'float'
c:\program files\microsoft visual studio 8\vc\include\string(528) : see declaration of 'std::getline'
c:\documents and settings\jcoleman\desktop\blackjack\blackjack\linked_list.h(26) : error C2780: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)' : expects 3 arguments - 2 provided
c:\program files\microsoft visual studio 8\vc\include\string(476) : see declaration of 'std::getline'
Build log was saved at "file://c:\Documents and Settings\jcoleman\Desktop\Blackjack\Blackjack\Debug\BuildLog.htm"
Blackjack - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========