Fight

Fight

Attached: 3.jpg (500x89, 9K)

Anyone who uses array syntax in arguments list is a retard

c++ is obsolete

I feel like it's a pointer to an array.
A pointer to pointers is just not as clear.

why?

I prefer the first option.

Because it is misleading.

First one in C++, second one in C

Niether.

int main(int argc, char** argv)

I never got why the hell you would put the ** to the right. Keep the type on one side.

Who cares? Is choosing one over the other going to make your code better? Doubt it

why is it misleading?
void foo(int **a)

is easier overlooked than
void foo(int *a[])

Whether something is a pointer is not a part of the type, so it is really poor style to try to make it look like it is.

int a, b, *c, *d
c and d are obviously pointers here. The idea of putting the * as the type breaks in this example..

Because you can declare variables like this:
int i, *pi, &ri;
and this looks like shit.
int* i, &ri;

char** c1, c2
char **c1, **c2

>2 main functions
debug yourself

it's the opposite of misleading

see
also you're a retard

Since pass-by-copy is the default, using the int []arr syntax would suggest that an array is passed as copy.

Actually pointers are still part of the type, it's just that K&R went full retard just like in so many parts of C.

see
also you're a retard

uh, I've not done C in a looong while but shouldn't the [] be on the other side ?
also anyone who'se done any amount of C knows arrays transform into pointers
specifying they were arrays gives an indication on the nature of the argument

You should never declare 2 variables of different types on one line imo.

I don't see how that's a rebuttal, since it doesn't adress the issue
also you're still a retard

if pointer is part of the type, then dereferencing is casting

Retard here, what's the difference?

fpbp

None, codewise. Just a syntatical preference really.

I like char** better because I am lazy

only objective argument so far

You know we're not talking about java, right?

Spotted the Java brainlet

dumbass

int main(int argc, char* argv[argc[)

int main()

Attached: 1518438985556.gif (330x271, 1.44M)

>[

You just got dunkt by
Now where is my gif of a bunch of young suburban black kids freaking out over a sick burn

sorry.

I like char**

I can see why people like *[] but its adding more symbols than I want to deal with. Yall should know what a char ** is and how it works. I dont want to be looking at brackets and shit

jesus

public static void main(String... args)

Attached: flat 800x800 075 f.u5.jpg (800x800, 71K)

/thread

>Void

The Main method returns an integer regarding its exit status (0 for success, 1 for failure).

main()

auto main(int argc, char **argv) -> int

Attached: 1497164816141.gif (220x388, 256K)

The first one is objectively better because it better shows the intent of the argument, that it is an array of strings and not a pointer to a pointer of a string.

Because array parameters don't exist in C. arg[] is syntactic sugar for *arg in a parameter list. Using array syntax in a parameter list could lead people to believe the array behaves the same as an array declared in the function body.

#include

void fn(char arr[5])
{
printf("%zu\n", sizeof arr); // prints sizeof(char*)
}

int main()
{
char arr[5];
printf("%zu\n", sizeof arr); // prints 5
fn(arr);
}

This if you don't need args, otherwise char** argv because it's easier to type

Attached: 1525173504072.png (217x190, 55K)

Delete this.

Attached: 1525140854409.jpg (500x428, 146K)

are you autistic?

The standard defines EXACTLY int main(void) or int main(int argc, char *argv[]) or equivalent. Everything else is non-standard, including "void main()" or "int main()".

>pointer to array in main
>double pointer in other function declarations

But it’s not? It’s an array of pointers.

function main(c, v) {

>2018
>not using float main()

>the language is misleading if you don’t know it
Oh well

>raw pointer
no thanks

what a fail

Dereferencing is an operator that results in another type, just like casting, function calling or the index operator. If K&R didn't call it that way it just shows what they knew about programming languages.

also all of you are retards and need to fuck off and learn about programming language design

void main()

are you employed

How does an array behave different in the function it was declared? How does sizeof know its length?
Thanks for the knowledge above!

When you pass an array as an argument to a function, you're only passing a pointer to it, which means sizeof will return the size of the pointer rather than the size of the whole array.

c = 5
why doesnt it work? oh maybe because ITS NOT TYPE INT. you are fucking retarded

but when you declare an array, all youre doing is the same. You get a pointer to the start. How does sizeof understand the size of it?

Good taste desu

Bhhahahahaha

>main
>not WinMain
lol you're all unemployed kids

Attached: 1493421857957.gif (200x133, 929K)

Retard, you read types right to left.

sizeof never returns the size of the array in C, it has the same behaviour everywhere.
Every "array" variable is just a pointer to the first element, in fact the var[x] sintax is just a shorthand for pointer arithmetic.

Thanks for responding. Thats my understanding but in , the sizeof returned the actual size of the array

sizeof(arr)/sizeof(arr[0]) does give the lenght of the array user

double pointers for everything

Wrong. when declared as a static array the entire thing is allocated on the stack and the size cannot be changed therefore sizeof knows the full size of the array at compile time whereas as sizeof cannot determine at compile time the size of an array being passed in as an argument to a function becuase it is just a pointer that could point to an array of any size during the execution of the program

char* c is C++
char *c is C
char * c is autism

Thank you. Its clear now.

pussy lmao

Sorry, didn't think that worked.
Well, the last bit is right anyway.

where does the asterisk go on a function that returns a pointer?
int* foo() {

or
int *foo() {

int /*fuck*/ * /*you*/ foo() {

int *
foo()
{

Whats a good way to learn about docker and put it up on github? tenks

it demonstrates the intent of the function better than a double pointer

int * foo()
{
return NULL;
}

you guys are the best

short main[] = {
277, 04735, -4129, 25, 0, 477, 1019, 0xbef, 0, 12800,
-113, 21119, 0x52d7, -1006, -7151, 0, 0x4bc, 020004,
14880, 10541, 2056, 04010, 4548, 3044, -6716, 0x9,
4407, 6, 5568, 1, -30460, 0, 0x9, 5570, 512, -30419,
0x7e82, 0760, 6, 0, 4, 02400, 15, 0, 4, 1280, 4, 0,
4, 0, 0, 0, 0x8, 0, 4, 0, ',', 0, 12, 0, 4, 0, '#',
0, 020, 0, 4, 0, 30, 0, 026, 0, 0x6176, 120, 25712,
'p', 072163, 'r', 29303, 29801, 'e'
};

It doesn't work because you picked a shit name for your variable, retard.

It's an array of strings.

>Whether something is a pointer is not a part of the type
Yes it fucking is. Whoever designed C to be retarded in this aspect is fucking wrong.

Guidelines for the F-35 coding style drafted by Bjarne himself discourages the use of double pointers for runtime safety reasons.

but doesn't bjarne prefer type* name style declarations? does he write type* name[] lol?

The C++ gnome is not a god though

dumb anime jew niggers

>he thinks the main method in java returns int
Speak for yourself

you don't even have to declare void.
main(){}

They're the same so it doesn't matter. People who can't adapt are shit programmers.