Write a function for update first argument depends upon second argument | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a function for update first argument depends upon second argument

If second argument input is 'on' then first argument is update with ON If second argument input is 'off' then first argument is update with OFF otherwise update with NONE

9th Nov 2021, 11:52 AM
venkatesh rapeti
venkatesh rapeti - avatar
2 Answers
+ 5
This forum is for helping people to clear their doubts or to fix their code. Not for free assignments. If you did a code and got any errors and don't know how to fix that, then share it, we can help =)
9th Nov 2021, 11:56 AM
Rishi
Rishi - avatar
+ 4
if arg2 == 'on' arg1 = ON else if arg2 == 'off' arg1 = OFF else arg1 = NONE ... ? Need better description of what you are struggling with / actually need to achieve. Assuming that your question is related to the one you posted earlier, then from your the code you wrote, seems like you're not accurately interpreting the question. https://www.sololearn.com/Discuss/2920458/?ref=app My understanding is that the first argument is an enum, not a char*. https://code.sololearn.com/cr93iixHfo8C/?ref=app
9th Nov 2021, 2:33 PM
Hatsy Rei
Hatsy Rei - avatar