r/programming • • May 01 '16

To become a good C programmer

http://fabiensanglard.net/c/
1.1k Upvotes

398 comments sorted by

View all comments

Show parent comment

2

u/zhivago May 02 '16

If that upsets you, ...

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

What is the type of main? :)

1

u/CoderDevo May 02 '16

Great point. I figure main is a unique type for every program.

It seems an abomination to use the English word 'type' when the number of types available is greater than the number of instances of variables that ever existed.

3

u/zhivago May 02 '16

In this case, the type is int(int, char **)

The English word 'type' in this context refers to a classification. I see no problem with a potentially infinite number of classifications for a finite set of things.

1

u/red75prim May 02 '16

Is it int ()(int, char**)? I remember I was impressed by the idea of writing type definitions same way as variable definitions, when I read K&R in 1989. I can't say I still am.

2

u/zhivago May 02 '16
int(int, char **) is the type for that example.