N
N
notxleb2017-10-17 20:34:48
C++ / C#
notxleb, 2017-10-17 20:34:48

How does fscanf()/C work?

59e63ef641f29469957903.png59e63f02166df130255656.png
Where does the place to write a line from a file come from?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
15432, 2017-10-17
@notxleb

The place doesn't appear out of nowhere, you have to select it yourself. In your example, the place is just not allocated, so the cells allocated for local variables will be overwritten with a line from the file, [possibly] the stack will be damaged and the program will crash. Try the same but with a longer string than "cat"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question