Error help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neo

    #1

    Error help

    Hi friends
    where will I get error descriptions for numorous errors I am getting on
    my pgm?

  • Ravi Uday

    #2
    Re: Error help



    Neo wrote:
    [color=blue]
    > Hi friends
    > where will I get error descriptions for numorous errors I am getting on
    > my pgm?
    >[/color]
    What errors ? Compilation/Runtime ?

    Generally during runtime, if a system call fails, it sets the global
    variable 'errno' with a error number (generally defined in errno.h)
    Now if you want to see the error descriptions you can use a standard
    function 'strerror( errno );' which returns a pointer to char
    describing the latest error in a string equivalent form.
    You could probably print the error like -

    printf ("Error = %s\n", strerror(errno) );

    - Ravi

    Comment

    • Mark McIntyre

      #3
      Re: Error help

      On 6 Apr 2005 04:25:13 -0700, in comp.lang.c , "Neo"
      <bvasundhar@gma il.com> wrote:
      [color=blue]
      >Hi friends
      >where will I get error descriptions for numorous errors I am getting on
      >my pgm?[/color]

      from the documentation for either the application or your compiler, or
      your OS, depending on which is generating the errors.

      (C doesn't mandate any specific error numbers or codes, this is
      implementation specific)

      --
      Mark McIntyre
      CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
      CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

      Comment

      • Andrey Tarasevich

        #4
        Re: Error help

        Neo wrote:[color=blue]
        > where will I get error descriptions for numorous errors I am getting on
        > my pgm?[/color]

        Humorous? Or numerous?

        --
        Best regards,
        Andrey Tarasevich

        Comment

        • Joe Estock

          #5
          Re: Error help

          Neo wrote:[color=blue]
          > Hi friends
          > where will I get error descriptions for numorous errors I am getting on
          > my pgm?
          >[/color]

          perror() and a decent c manual would be a good start.

          Comment

          Working...