basic question in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

basic question in c++

in string class we have function basic_string& append(Inputiterator_first,Inputiterator_Last) my question is what is meaning of '&' and why they have put '&' sign between string and append

29th Jun 2018, 12:04 PM
Bahubali
Bahubali - avatar
3 Answers
+ 2
format is always the same : return_type name(parameters) so the function returns a reference (here is the use of '&') to a basic_string checkout reference for more information & examples : https://en.cppreference.com/w/cpp/string/basic_string/append
29th Jun 2018, 6:10 PM
darrencweid
darrencweid - avatar
+ 1
thank u ~ swim ~ and darrencweid
30th Jun 2018, 8:04 AM
Bahubali
Bahubali - avatar
+ 1
~ swim ~ yes thanks, fixed ;)
30th Jun 2018, 10:46 AM
darrencweid
darrencweid - avatar