int* ip or int *p
int* ip I dont declare multiple pointers on one line so int* ip, *dp doesnt happen
>>fprog-1606BEVL (OP) int * p but if you want to be a faggot about it int* p is better than int *p. the type is an "int pointer" so it should go together
>>fprog-ADZUP3XB but if you declare multiple pointers it gets confusing int* p, q; only p is a pointer, but >the type is an "int pointer" makes you think both are so use int *p, q; for clarity's sake the '*' modifies the variable, not the type
>>fprog-1606BEVL (OP) But how do you access struct members? struct garbage garbage1; garbage1.item1 ----or---- garbage1->item1
>>fprog-0I7KWJIV if garbage1 is a pointer, i use garbage1->item1 else /* it is a regular variable */ i use garbage1.item1
>>fprog-0I7KWJIV If garbage1 is a pointer >> garbage1.item1 is wrong bro. You can only use >> garbage1->item1
>>fprog-SG6H9U6I then do >int * p, * q; it's still easier to see it as "int pointer" with this exception
>>fprog-B0W2SD51 >2 spaces now that is just silly
>>fprog-1606BEVL (OP) When I started C, I looked at C code to choose my coding style. Here are some of my inspirations: https://aiju.de/misc/c-style https://man.openbsd.org/style https://suckless.org/coding_style/ https://man.cat-v.org/plan_9/6/style Some code I looked at was the plan9 source code and dwm source code. Hope that helps!
>>fprog-F251CGFK my style is based on some of those as well thank Stallman for all the libreware out there that helped me learn
>>fprog-F251CGFK I like GNU style. check glib and GTK, the code style is pretty neat
All trademarks and copyrights on this page are owned by their respective parties.
v0.2.0-c793a28