#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    53
    Rep Power
    11

    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.
  2. #2
  3. jasondoucette.com
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    378
    Rep Power
    12
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    53
    Rep Power
    11
    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.

IMN logo majestic logo threadwatch logo seochat tools logo