One of my C++ books was showing the line
cin.getline(arg, arg) and later showing
getline(cin, arg). Why is the second one not object.function and yet have the object as one of the arguments? What's the difference?
Jump to Post
Those two functions essentially do the same thing (read a line from cin). The difference between the two is that the member function (
cin.getline(..)) takes an argument (the string to be filled in with the content of the line) as a
char*, which is the C-style representation for strings (a …
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.