Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

ajuda para correção de erros em linguagem C

0 votes
asked Nov 10, 2023 by Ana Clara Gomes Ricotta (120 points)
Estou com um código pronto e sem erros em linguagem C mas algumas funções não exercem exatamente o que eu estou precisando e não consigo identificar onde estão os erros. Existe alguma maneira de encontrar onde estão essas falhas em um código linguagem C? Somente procurando linha por linha?

1 Answer

0 votes
answered Dec 6, 2023 by Peter Minarik (86,240 points)
If your code compiles without any errors then you indeed need to figure out what's the issue by looking at the code line by line.

You can try to narrow down where things could go wrong by looking at the compiler warnings, if any.

Furthermore, you can add some logging (printing of debug messages) to a file or console to keep track of what your program is doing and where things could break; and just to verify that it is doing whatever it is supposed to do.

You can also use a debugger where you can execute code line by line, check the values of variables, place breakpoints in your code, and many more. Most IDEs have a debugger, OnlineGDB has a debugger too.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...