What's the equivalent call() apply() of JavaScript in C?

In Java it is:

  • java.lang.reflect.Method

In JavaScript it is:

  • apply() ⟶ more like java.lang.reflect.Method

  • call() ⟶ more like function pointer in C

In C it is:

  • type (*varname)(Type1 label1,Type2 label2,Type3 label3) ⟶ call()

  • What is the equivalent in C of apply() or java.lang.reflect.Method?

------------i am pretty slow, the answer from eyalm:

the caller perceive the callee as :

  • int (*a)(char value);

and the callee perceive the stack frame as :

  • Type (*varname)(Type1 label1,Type2 label2,Type3 label3 ...)

---- am i right?

Answers


For the function pointer:

int (*a)(char *);

you can call with ... wait for it ...

a("ggffgfgg");

Need Your Help

which open source project(s) uses the castle activerecord?

.net castle-activerecord

Rather than the demos can you suggest any open source projects using castle activerecord for code study?

Android: setPictureFormat() error

java android

I'm a beginner in Andoird, currently trying to write an application using the Camera class of Android in Eclipse. The problem is when I call the parameters.setPictureFormat() method with ImageForma...

SizeToContent paints an unwanted border

c# wpf sizetocontent

Whenever I try to make a window and I set the SizeToContent to WidthAndHeight, on opening the window correctly sizes to it's contents, but it adds a small border to the right and the bottom. On res...