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?
lewashby
56
Junior Poster
Recommended Answers
Jump to PostThose 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 achar*
, which is the C-style representation for strings (a …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.