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

Pages: 1-

Why is C so bad?

Name: Anonymous 2011-10-14 1:31

Why can't I just declare a function without specifying the return type? Surely the C compiler would be able to figure out the type from what I am returning.

Name: Anonymous 2011-10-14 1:33

C is not for idiots. Go back to Python, please!

Name: Anonymous 2011-10-14 1:37

>>2 Cretin.

>>1
That's how the language is defined and the syntax makes sense once you see the big picture.  You don't like it?  Use something else or write your own.

Name: Anonymous 2011-10-14 2:07

typedef void *(*func)(void *, ...);

there you go.

Name: Anonymous 2011-10-14 4:15

OP doesn't know types. Typical Python faggot.

http://en.wikipedia.org/wiki/C_syntax#Integer_types

Name: Anonymous 2011-10-14 6:07

The official FAQ explains why C is so bad.

http://www.c-faq.com/malloc/sizeof.html
Q: Why doesn't sizeof tell me the size of the block of memory pointed to by a pointer?
There is no portable way to find out the size of a malloc'ed block. (Remember, too, that sizeof operates at compile time, and see also question 7.27.)

Name: Anonymous 2011-10-14 6:12

>>6
There is a way!

        char *str = (char*) malloc(sizeof(char)*1000);
        int *length = str-sizeof(int);
        printf("Length of str:%d\n", *length);

It works on GCC/MSVC and nobody uses other compilers

Name: Anonymous 2011-10-14 6:22

>>7
It has got more to do with the standard library than the compiler. Really, you shouldn't do that.

Name: Anonymous 2011-10-14 6:23

>>7
That shitty piece of code working has nothing to do with the compiler used.

Name: Anonymous 2011-10-14 6:26

>>8
Why not? It saves me few keystrokes to pass length everywhere.

>>9
It works, bitches!

Name: Anonymous 2011-10-14 6:37

>>6
For Windows you can use _msize(). In Linux everything is made of crap, so you will have to recompile kernel or something to get mem.

Name: Anonymous 2011-10-14 6:37

>>10
It won't work with any decent malloc() implementation. Where does that piece of shit work anyway? Certainly not in modern desktop OSs.

Name: Anonymous 2011-10-14 6:41

>>12
Use Windows.

Name: Anonymous 2011-10-14 6:47

>>10
There are persons who have actually created the C++ language who will tell you the same thing that I'm telling you -- stop wasting time trying to "beat the system", because in the end, you can't.

Name: Anonymous 2011-10-14 6:48

>>7
>>10
http://www.youtube.com/watch?v=umDr0mPuyQc


Also it does not work on 64 bit systems with gclib.

Name: Anonymous 2011-10-14 6:50

>>15
just change +4 to +8.

Name: Anonymous 2011-10-14 6:56

>>11
MacOSX has malloc_size() too!

Linux sucks gay ass.

Name: Anonymous 2011-10-14 8:16

>>11,12,13,15,17

Hey, who left the door to /g/ open again?
The door is to be closed and sealed at all times!

If the door isn't closed at all times, all the 'murrikan VB6 furrytards who think they've figured the IT world out, infest threads like these with their bullshit.

Please think of the real programmers!

Name: Anonymous 2011-10-14 8:32

>>18
Real programmers code Lisp.

Name: Anonymous 2011-10-14 8:44

>>19
Real autistic programmers code Lisp.
Real autists also say ````code'''' instead of `write', due to critical amounts of autism.

Name: Autistymous 2011-10-14 8:47

>>20
Nice introspection, autist.

Name: Anonymous 2011-10-14 9:21

>>7
Nice way to break whole program if I change malloc() with different implementation (LD_PRELOAD=libdmalloc)

Name: Anonymous 2011-10-14 10:00

>>22
It is C. What else you expect?

Name: Anonymous 2011-10-14 10:22

if you knew anything about malloc you wouldn't want to know the exact memory allocated, it is the way it is for efficiency, not for autistic every-byte-is-sacred fucks who complain about C

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