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

-std=c99 my anus

Name: Anonymous 2009-11-25 15:29

[code]$cat test.c
#include <stdlib.h>
#include <string.h>

int main(void) {
    char *foo;
    foo = strdup("bar");
    free(foo);
    return 0;
}
$gcc test.c
$gcc -std=c99 test.c
test.c: In function 'main':
test.c:6: warning: implicit declaration of function 'strdup'
test.c:6: warning: assignment makes pointer from integer without a cast[code]
What the heck is this, /prog/? Is there some shit around strdup() in c99?

Name: Anonymous 2009-12-01 19:29

>>56
Haha oh wow. I don't understand const because I think it's short for "constant". I fucking lol'd.

We all know how const volatile works and how it applies to memory mapped input, among other things. const does not mean the value can't change; just that this variable can't be used to change it.

This is the stupidest argument I've ever had on /prog/, and I've argued with FV. I going to check out now, thanks. I'm off to read more about D, where const is actually done properly.

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