How to use C code playground | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

How to use C code playground

My main problem is that when I run my code here on sololearn and try to run a text input appears , I am not sure what to input exactly especially that the code scans many arrays on for loop , what to do please ??

25th Oct 2018, 6:40 PM
Sherouk Rashed
Sherouk Rashed - avatar
1 Antwort
+ 1
Have you used any C IDE before? If so, you are probably used to a command line style input, and you think that scanf() prompts for input. It doesn't. It simply scans the stdin file which may, or may not, be mapped to a command line by another program/the operating system. If not, here's what you need to know. What you need to input is the contents of a file (stdin). scanf looks in this file. For example if the file is """ 25 -78 23 """ the first time you call, say, scanf("%d", &n) it will put 25 at the location of n. Suppose latter you call scanf("%d%d", &x, &y), the x will be -78 and y 23. If you call it again later your arguments will remain unchanged and it will return a value representing an error. If your code reads "%d" in a loop 10 times, you are going to need to enter 10 integers before at the text input.
25th Oct 2018, 7:13 PM
Vlad Serbu
Vlad Serbu - avatar