/dpt/ - Daily Programming Thread

previous :: Thread
previous =

Attached: >λ=.png (10x8, 348)

Other urls found in this thread:

github.com/friendlyanon/cmake-init
twitter.com/SFWRedditGifs

print("hi")

new() Thread;

nth for >λ=

Reminding anons to use github.com/friendlyanon/cmake-init when creating new C++ and C projects!

I don't get cnile
char *x = reallocarray(NULL, len, sizeof(char));
x = reallocarray(x, 2 * len, sizeof(char));

why can't the second line be *x = reallocarray(...); when the first line uses *x
wtf

the * is part of the type, char*

Because pointers are actually a type, and only bind to the variable in declarations (e.g. for char* x, y, z; only x is a char*, whilst y and z are just chars).

but C has stupid poorly thought out syntax so char* a, b is char* a and char b

The syntax made sense for B, where everything is a word.

int x = 2;
int *ptr = &x;
*ptr = 3; // what is this then?

an assignment to a place pointed by ptr - what is your point?

* is an operator in an expression in the bottom line

would make more sense if
char *x, y, z;

void(*f, **g, h)(void)

>what is your point?
* is part of the variable

No.

rewriting c++ game engine in c

>When your oil has erased the keycaps on another keyboard
Is there a better feeling for productivity than seeing even the T and Y fade?
Line count fags with coloured polymers need not apply.

It doesn't, because you can't write int *x, long y, const z; despite them also being type modifiers.

Dereference operator. You can assign address directly to ptr without it.

I don't know what you're babbling about
int *x, y, z;

>working on embedded c project
>co-worker asks where is the int32_t defined
wtf isn't that enough reason to fire that asshole on the spot

actually knowing how to program is a rare talent in programming