Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

I need some help with C programming in Linux

Name: Anonymous 2006-05-14 17:46

Hello, I am using some functions that on error se some value to the errno variable, but I don't know how I can get the value of this variable. thanks.-

Name: Anonymous 2006-05-14 17:55

how do i included <errno.h>?

Name: Anonymous 2006-05-14 19:44

>>2
sry dno pls tel

Name: Anonymous 2006-05-15 3:00

ON ERROR GOTO <linenum> OR GTFO

Name: Anonymous 2006-05-15 9:00

Name: Anonymous 2006-05-16 3:52

Pussies.

>>1
#include <errno.h>

if (errno == ...) {perror("You fail etc");}

Name: Anonymous 2006-05-16 12:41

#include <string.h>
#include <errno.h>

fprintf(stderr, "%s\n", strerror(errno));

Name: Anonymous 2006-05-17 1:41

>>6 those errno.h
i thought u were writing include emo.h XD

Name: Anonymous 2006-05-17 3:12

>>8
Me too!

Name: Anonymous 2006-05-17 10:44

>>9
Me too!

Name: Anonymous 2006-05-19 8:31 (sage)

>>10
Me too!

Name: Anonymous 2006-05-19 10:44

>>11
Me too!

Name: Anonymous 2006-05-19 15:51 (sage)

>>9
>>10
>>11
>>12

I didnt.

Name: Anonymous 2006-05-20 0:04

>>13
I did.

Name: Anonymous 2006-05-20 12:00 (sage)

sage

Name: Anonymous 2006-05-21 15:15

age

Name: Anonymous 2006-05-21 15:19 (sage)

sex

Name: Anonymous 2006-05-21 15:51

wow global variables. that's so retarded.

Name: Anonymous 2006-05-21 16:02 (sage)

>>18

sage for retarded statement

go learn to think for yourself instead of what your professors cram down your throat

Name: Anonymous 2006-05-21 17:34

>>19
True. Most things a language provides have their use, and you can abuse every single feature. You shouldn't avoid things that could be abused or failed; you should be learn to use the right tool for every time and tell when something is a good or a bad idea.

Name: Anonymous 2006-05-22 1:54

>>20
Untrue.  The "auto" keyword in C has NO use.

Name: Anonymous 2006-05-22 2:01 (sage)

>>21
the "auto" keyword is not 'most things' the C language provides.

Name: Anonymous 2006-05-22 3:14

people who use global variables, goto, or operator overloading have failed at life.

Name: Anonymous 2006-05-22 3:26

>>23

Translation: "John Carmack, the Nethack programmers, and anyone who ever wanted to write something as simple as string concatenation or making complex number arithmetic not-a-coding-eyesore have failed at life."

Which also translates to "I have no fucking idea what I'm talking about because I critique code more than I have ever written any of it."

Name: Anonymous 2006-05-22 3:30 (sage)

>>23
people who replace global variables with things like passing extra arguments to every function, or some object that contains config settings, etc. and then act like this method is superior have not only failed at life but have shit all over it.

Name: Anonymous 2006-05-22 3:36

>>24-25
Agreement

>>23
You haven't done much, right? Or if you did, you like suffering, right?

Name: Anonymous 2006-05-22 7:44

>>23
Next you'll try to tell us how great Java is

Name: Anonymous 2006-05-22 9:08

>>18
Untrue. "errno" is actually a thread-local variable, not a global one. Check its definition on your average linux system and you'll likely find that it's something like (*__errno_location()) or some such, which results in getting it from the thread-specific storage area.

Name: Anonymous 2006-05-22 9:09

>>23 for pres- professor

Name: Anonymous 2006-05-23 14:30

>>27
Sun-certified professionals can rapidly establish credibility, resulting in peer recognition and professional advancement. As one recent Sun-certified professional said, "Certification helped cement my position in the Java technology community."

Name: Anonymous 2006-05-24 2:06

>>30"Certification helped cement my position in the Java technology community and we can all sleep with the fishes in the bottom of the sea."
Fixd!

Name: Anonymous 2006-05-24 7:17

"Certification helped cement my position in the Java technology community."
Which means it's worthless :D

Name: Anonymous 2008-04-14 23:53

:D

Name: Anonymous 2008-04-15 1:16

#include <errno.h>
#define errno 0

Name: Anonymous 2008-04-15 2:16

>>34
/usr/include/errno.h:46:1: warning: this is the location of the previous definition

Name: Anonymous 2008-04-15 6:44

>>34
Wow, this is a great idea which I will promptly use the next time I have to deal with any sort of error checking.

Thanks Anon, you're a lifesaver.

Name: Anonymous 2010-06-07 6:41

Hi, I can spam /prog/ too, you faggot.

Also, smoke weed everyday.

Name: Anonymous 2012-03-28 2:22

my farts burn my anus
it hurts
in a good way

Name: Sgt.Kabu唾玤kiman䚊 2012-05-28 18:54

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List