Passing strings inside quotes to a function misunderstanding | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Passing strings inside quotes to a function misunderstanding

https://code.sololearn.com/cg4XTGu3MGs1/?ref=app Why cant I do this? (Line 6)

10th Nov 2018, 4:23 PM
Slewq
Slewq - avatar
5 Answers
+ 6
Slewq Sorry i made myself unclear. You have two ways one is storing in main other is storing in function. Here a example just changing the function. https://code.sololearn.com/cqt0TEu08Eid/?ref=app
10th Nov 2018, 4:56 PM
Anya
Anya - avatar
+ 5
You can but you need to store Hey somewhere. Can be in main and you pass in function or similar logic comparing your code could be your pass hey like you did but catch's using a local function char[] variable after that you makes the assignment.
10th Nov 2018, 4:46 PM
Anya
Anya - avatar
+ 5
Slewq sorry i updated. You are welcome.
10th Nov 2018, 5:13 PM
Anya
Anya - avatar
+ 2
Anya hi, I cant change the main function.
10th Nov 2018, 4:50 PM
Slewq
Slewq - avatar
+ 2
Anya you have made some mistakes but I got your point and it is works perfect thank you.
10th Nov 2018, 5:08 PM
Slewq
Slewq - avatar