Attached: CIsn'thHard.png (1058x794, 76K)
Untitled
Josiah Baker
Brandon Morgan
checkem
James Perry
What a dishonest position to take. Most of C is simple, however, some aspects of the language have a quirky syntax.
Andrew Carter
Read the spiral rule article on c faq if it's confusing
Luke Sanders
Name a more flexible language
Angel Collins
Japanese. I'd love to see if C's characters bend the way kanji does.
Carson Barnes
Kind of like saying Buffalo buffalo buffalo Buffalo buffalo, though. Like, no shit it's dense, but it's also not something you'd use.
Ryan Cook
C is very simple. There are a couples of design flaws in its syntax, but most other languages are a lot more complex than C.
Ethan Gomez
what would void (*f[])() be?
Jordan Brown
f is an array of unspecified length, containing pointers to functions that takes unspecified arguments and return void.
James Stewart
but thats exactly what OP wrote?
Cameron Murphy
An array of pointers to functions doesn't seem like that far-fetched or obscure a piece of code. I'm sure lots of people have come across it.
Ayden Murphy
/thread
Landon Wright
why doesnt this follow standard syntax?
like int array[5];
and so void (*function)() [5]
Ian Johnson
OP's one is wrong. It's actually:
f is an array of unspecified length, containing pointers to functions taking no arguments, which return a pointer to a function which take no arguments and return void.
Noah Scott
the name of the variable is the anchor here
Brody Allen
ah that makes sense
now that sounds more like something u never use
Camden Thompson
Almost all 'tricky' uses of function pointers are simplified with typedefs.
Because that's not how the C function syntax works. It all starts at the variable name and recursively works its way out.
Kayden Brown
>taking no arguments
Actually, I need to correct myself.
It takes unspecified arguments, which is subtly different in C.
Jaxon Gonzalez
could I have a function that returns itself in C?
Jace Reed
This.
There’s clearly another layer of the pointer.
Bentley Rodriguez
maybe the joke that "C isnt that hard" is that it is hard: the description is wrong because C is hard.
Christian Parker
Common Lisp
Dylan Jackson
Yes easily
void * f()
{ return (&f)(void *);}
Brandon Turner
British English
Landon Perez
Not directly. You'd have to go through a void *.
The standard doesn't guarantee that a function pointer is convertable to a void pointer, but POSIX does.
Parker Young
if all you did was look at that without prior knowledge, sure its hard
if you took 2minutes to learn functions, arrays and pointers, its not hard at all
Alexander Long
Top kek.
Lincoln White
I’m an idiot
The function f will need to be defined as static first. Otherwise it may need stack operations
Cameron Hill
What is some magic shit you can do in C, like the weird duff machine
Gabriel Moore
Forth. Wow that was easy. C is very inflexible actually.
Grayson Roberts
Forth is awesome thats why everyone uses i-
Alexander Lewis
>Javascript is the most amazing programming language ever made thats why everyone uses it.
Easton Allen
thats stepping over the line, sir.
I have pajeet on the phone right now. He told me if you don't back off, he will poo in your loo.
Dylan Turner
Are you crazy? We can’t let that guy get his hands on the poop-lear codes
Oliver Collins
JavaScript
Angel Thomas
I’ll try to retract the cringe of that joke now.
Kayden Wright
Function pointers in C might just be the single most retarded piece of syntax ever invented.
Matthew Garcia
#define blabla(X) (*(*X[])())()
Colton Butler