Untitled

Attached: CIsn'thHard.png (1058x794, 76K)

checkem

What a dishonest position to take. Most of C is simple, however, some aspects of the language have a quirky syntax.

Read the spiral rule article on c faq if it's confusing

Name a more flexible language

Japanese. I'd love to see if C's characters bend the way kanji does.

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.

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.

what would void (*f[])() be?

f is an array of unspecified length, containing pointers to functions that takes unspecified arguments and return void.

but thats exactly what OP wrote?

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.

/thread

why doesnt this follow standard syntax?

like int array[5];
and so void (*function)() [5]

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.

the name of the variable is the anchor here

ah that makes sense
now that sounds more like something u never use

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.

>taking no arguments
Actually, I need to correct myself.
It takes unspecified arguments, which is subtly different in C.

could I have a function that returns itself in C?

Attached: ocdonut.png (626x418, 191K)

This.
There’s clearly another layer of the pointer.

maybe the joke that "C isnt that hard" is that it is hard: the description is wrong because C is hard.

Common Lisp

Yes easily

void * f()
{ return (&f)(void *);}

British English

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.

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

Top kek.

I’m an idiot
The function f will need to be defined as static first. Otherwise it may need stack operations

What is some magic shit you can do in C, like the weird duff machine

Forth. Wow that was easy. C is very inflexible actually.

Forth is awesome thats why everyone uses i-

>Javascript is the most amazing programming language ever made thats why everyone uses it.

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.

Are you crazy? We can’t let that guy get his hands on the poop-lear codes

JavaScript

I’ll try to retract the cringe of that joke now.

Function pointers in C might just be the single most retarded piece of syntax ever invented.

#define blabla(X) (*(*X[])())()

Attached: serveimage.png (282x179, 14K)