C debugging problem
Hi, I have problem when trying to output something in the C code. It seems that using printf, the output doesn't want to come out when I try to find the place of error even when it has passed the printf function. However, when I try to use perror, the message can come out. Can anyone help me the better way to debug a program in C? If I want to display the value of some variable, what function should I use if the program still got errors? Thanks. Hope to hear quick response.
printf should be fine. What OS are you using? Show us the code that is given you the problem. Perhaps, make a very small program that uses both printf and perror and see if it works - if it doesn't, show us, and we'll take a look at it.
Hehe..It's my fault not familiar with C. I just found out that we should end with newline to make the string can be output to the screen directly. Thanks anyway.