previous :: Thread
previous =
/dpt/ - Daily Programming Thread
Other urls found in this thread:
github.com
twitter.com
print("hi")
new() Thread;
nth for >λ=
Reminding anons to use github.com
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