0

Hello bosses i need some help

I want to write a small program but i got a big problem :) this code run properly on my pc but here it wont work. I tried with fgets but it won't work. i want to compare user input like strcmp(response, "much, more") how can i do that? https://code.sololearn.com/cjk9sOBVwv3m/?ref=app

24th Feb 2022, 4:26 PM
Cristian Dumitrache
Cristian Dumitrache - avatar
5 Answers
+ 2
while(1){} does not work in Sololearn. your code is executed on the server side. you can't hold the server with while(1) forever. it will work only when input == ok other inputs will just hold the server waiting for another input, and it's not possible to enter one again after hitting run.
24th Feb 2022, 5:56 PM
Bahha┣
Bahha┣ - avatar
0
Hmm i wonder how can i take a string input with space in it , in this case
24th Feb 2022, 7:07 PM
Cristian Dumitrache
Cristian Dumitrache - avatar
0
use fgets instead of scanf in case you need to enter multiple inputs in sololearn you can write them in multiple lines. ie input 1 input 2 input n... then submit
24th Feb 2022, 7:59 PM
Bahha┣
Bahha┣ - avatar
0
Hmm thx you are a C dev?
24th Feb 2022, 8:01 PM
Cristian Dumitrache
Cristian Dumitrache - avatar
0
not specifically, I use C when I have to.
24th Feb 2022, 8:12 PM
Bahha┣
Bahha┣ - avatar