I have read in several books that in C the variables must be declared at the beginning of a block of code. But what happens if I declare them in the middle?
I was doing a program in c that shows text in a window created only using the X11 library. It had a function - split(...)
-, which inexplicably, every time I used it, the text appeared in random colors. Then you decide to move all program variables to the beginning of each block. And the problem is gone.
Then in C, declare variables in the middle of code blocks, can they cause the program to behave indefinitely?
But, I'm not sure that this was the cause of my problem. Link to question about my problem.