Strings as a function parameter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Strings as a function parameter

hello guys 🙏PLEASE GUIDE ME 🙏 how can I use a string as a parameter in functions in C++

1st Mar 2017, 10:29 PM
PayaM
PayaM - avatar
5 Answers
+ 10
luka, #include <string> instead of iostream twice? *confused*
1st Mar 2017, 10:54 PM
Tashi N
Tashi N - avatar
+ 8
Thx, I just thought I was to tired to get it :D
1st Mar 2017, 11:03 PM
Tashi N
Tashi N - avatar
+ 3
Maybe, you need to include #include <string> library at the top?
1st Mar 2017, 10:48 PM
Raphael Gutierrez
Raphael Gutierrez - avatar
+ 2
void example(string x){}
1st Mar 2017, 10:39 PM
Raphael Gutierrez
Raphael Gutierrez - avatar
- 1
ok but those are not work
1st Mar 2017, 10:40 PM
PayaM
PayaM - avatar