Which one Jow Forums?

Choose wisely!

Attached: 1520356180500.png (1024x1024, 11K)

Other urls found in this thread:

c-faq.com/decl/spiral.anderson.html
twitter.com/SFWRedditGifs

Pointer only applies to variable that immediately follows it, so c for clarity.

Everything should be a pointer.
Discuss.

int* x because it's a pointer to int

int* a, *???b;

with name is better, but dunno if put the space in function prototype without names

That makes zero sense. B since you're declaring that the variable is an int pointer, hence int*

B is how it should be, but C is the best sadly

only c is reasonable if you declare multiple pointers on the same line

>declaring more than one var in one line
And I'm not even an 80 char faggot.
Shit would slow down.

numD: &i32

Pointers are considered harmful. Languages that require use of pointers should not be used except for systems programming.

what is lisp?

Did you fail pointers class friendo?

because sharing vs copying is so transparent in pointerless languages

C

You shouldn't declare more than one thing per line anyway.

Yes ;_; pls no bully

B is the only correct answer.
You clearly display that it's an int pointer and not a multiplication or a dereference.
> But what about list declaration?

Attached: 1523130806764.png (209x228, 92K)

t. too retarded to learn how to use pointers

Attached: 1524931419354.png (207x243, 6K)

but C has the "declare it as you access it" way and you will access it as *variable thus c) is the right way

>int * numA;
niggerlicious

>int* numB;
cool alternative, I can see the appeal

>int *numC;
normal white man's annotation

>int& numD, numE;
would be the best way

But now it's confusing when you make assignments:
int *x = 0;

is very different to
*x = 0;

You forgot the obvious alternative...
uP s=1024*PS;int c=0,d,gc=0;scc**gs,*g,*h;pnode**L=malloc(s);

...use as few spaces as possible.

it's totally possible to say things are bad without violating global rule 3, you know

int* because it's a type.

you need to go back

int* numB;

That doesn't make any sense.
You're not dereferencing it when you declare it. And it shouldn't be confused as such.

he doesn't know...

Cuck

My prof told me it's *numC and he was smart so I do the same

Last one if you wanna declare one pointer
Second incase you want multiple pointers
If you use the first one pls reconsider ur life choices

numA, numB, and numC are pointers. *numA, *numB, and *numC are integers. Hence, the third option.

From K&R.

Attached: file.png (727x450, 68K)

int *i;
is a declaration that *i resolves to int.

That book is old, therefore irrelevant.

The variable is an int-pointer, not an int.

Attached: 1524934569553.gif (235x250, 97K)

int* a, b;

b isn't a pointer here.

/thread

* is the dereference operator, not a "pointer marker." To have a pointer type you need a typedef.

Then don't list declare pointers.
If done in the h-file any sane person will murder you.
If done in source, you generally want to initialise the values as you declare them.

I generally use int *a but sometimes you need to use int * a for versbosity.

why bother with variables then, and just use pointers.
Are we asm now?

It's also the multiplication operator, it depends on context.
Treat it as a pointer marker when marking variables as pointers, what's the issue?

t. internet tryhard

Should the pointers only point to other pointers?

it makes sense and it's the correct way, there is zero reasoning for int*

EVERYTHING is a pointer, including the pointers

i do b because thats how i was taught, dont know if its actually proper convention or not

int* var = asterisk used as a pointer marker
int * var= asterisk used as a multiplication operator
int *var= asterisk used as a dereference operator

ok

C, anybody who says otherwise is flat out wrong.
The only time int* is acceptable is as part of a function signature.

>don't use syntax that is superior so you can have giant block declarations instead!

int *pointer;

if (condition) {

}

void function() {

}

int* var - type int pointer?
int * var - type int times var?
int *var - pointer to type int

A and B are for tards

int *x = 0 also makes literally no sense in the context of a pointer unless youre setting it to null, in which case it should be NULL

except & is a pointer marker
as I said, C declaration way is 'declare it the way you use it', that brings sense into multiple pointer declarations, arrays, function pointers and everything else
int * var is not a valid statement anyway

I don't agree with, but I can tolerate int *var.
At least we're united in that int * var is retarded af.

int *num;

anything else is degenerate and misleading

can someone explain how to mechanically parse very long complicated c declarations?
wasnt there even some source snippet in k&r that dissolves c declarations into natural language
>pointer to pointer to int

c-faq.com/decl/spiral.anderson.html

>except & is a pointer marker
mmm... not really, it just an operator that give's you the address of whatever. It can only be used on the right hand.

As I said
I just find it a bit odd that some people want to have the type declaration split up.

hey I don't claim it's my preferred way, but it's consistent with C's twisted logic

>the field of programming has fallen this low

jewfaggotnigger

It's a pointer to an int you fucking retarded. Spiral rule.

Attached: 1527951681497.png (368x657, 257K)

nice, thx

by and for niggers, yes they are

Option C is what's used in any serious C book or code base.

There is nothing wrong with declaring two per line, as in:

struct foo *src, *dst;

Wowie this is the first time a Jow Forums thread has actually changed my mind

numC masterrace

Go back to java

>tfw just know high level langs like c# and will never learn to use pointers and related mid level things

Attached: 1470939988039.jpg (680x550, 163K)

i donno, i like B and C, A is for idiots, but for some reason i usually write B. i know this is a controversial subject but when i see
*foo

i think that you're applying the dereference operator to foo, sort of the opposite of

&foo


(the address-of operator)

so in terms of declaring things, i think

int* foo;


is saying "i am declaring that foo will be a pointer to an int" a little more clearly, which is different from anything to do with acting on foo with a dereference operator

it's just style, except for A. A is just idiotic

arrays in c# are pointers

idk man, I just know that arrays are collections of things

int *numC

is the way, the truth, and the light
plus, that's how you access the value at it, and the declaration reflects that

int* numB

is just flat out wrong and encourages people to get fucked by
int* var1, var2, var3; /* there's one pointer here lol */


int * numA

is sensible, and I don't hate it
but I don't like it

A looks like multiplication. C looks like dereferencing. B looks like neither and makes sense as the variable you're declaring is a pointer to an int, not an int itself.

Anyone who disagrees should quite frankly commit suicide.