Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #43617

Re: errno

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!mit.eternal-september.org!.POSTED!not-for-mail
From Richard <rgrdev_@gmail.com>
Newsgroups comp.lang.c
Subject Re: errno
Date Sat, 26 Apr 2014 23:56:02 +0200
Organization http://www.ieee.org/
Lines 30
Message-ID <87ppk3n4b1.fsf@gmail.com> (permalink)
References <ljh687$b06$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mit.eternal-september.org; posting-host="4af8175e487d1d8249b5548b81726a30"; logging-data="1146"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18J7X2msYvt7+UmpX4SN6y0LuLfuER2j1U="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:SbLpZY5sGAHfzJFoeD1rkjsfARA= sha1:ji6hZ7L5DDt0ce3r6daxEOYgHus=
Xref csiph.com comp.lang.c:43617

Show key headers only | View raw


"Bill Cunningham" <nospam@nspam.invalid> writes:

>     My little utility doesn't print an errno value like it should. I have 
> tried to fix it but have failed. I've never really used errno.h but always 
> perror() so what am I doing wrong here.
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <string.h>
>
> int main(int argc, char *argv[])
> {
>     long int a;
>     errno = 0;
>     if ((a = strtol(argv[1], NULL, 16)) == -1)
>         printf("%s\n", strerror(errno));
>     printf("%d\n", a);
>     return 0;
> }
>

0/10

Up yer game Bill. Even the regs who are chomping at the bit to show off
aren't biting anymore.

-- 
"Avoid hyperbole at all costs, its the most destructive argument on
the planet" - Mark McIntyre in comp.lang.c

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

errno "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-26 16:51 -0400
  Re: errno Eric Wolf <eric@boese-wolf.eu> - 2014-04-26 23:11 +0200
    Re: errno "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-26 17:17 -0400
      Re: errno Ike Naar <ike@iceland.freeshell.org> - 2014-04-26 22:35 +0000
        Re: errno "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-26 19:35 -0400
  Re: errno Richard <rgrdev_@gmail.com> - 2014-04-26 23:56 +0200
  Re: errno Barry Schwarz <schwarzb@dqel.com> - 2014-04-26 17:15 -0700
    Re: errno "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-26 20:23 -0400
      Re: errno "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-26 20:27 -0400
    Re: errno "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-26 20:42 -0400

csiph-web