Jump to content
xisto Community
Sign in to follow this  
cse-icons

Try This C problem

Recommended Posts

hi everyone,here is an exercise for u... I found it quite interesting... hope u like it too....The question is :How do you call a function, given its name as a string? Try it out and post the solution/example.... or post ur approach to the sol...a hint: the solution is not very difficult...I will post the solution next week....cya, keep trying... All the best. Cheers.

Share this post


Link to post
Share on other sites

hi everyone,

 

here is an exercise for u... I found it quite interesting...

hope u like it too....

 

The question is :

 

How do you call a function, given its name as a string?

 

Try it out and post the solution/example.... or post ur approach to the sol...

a hint: the solution is not very difficult...

 

I will post the solution next week....

 

cya, keep trying...

All the best.

 

Cheers.

43146[/snapback]

You may try something like function pointer.

I have an article about this:

http://forums.xisto.com/topic/833-how-to-make-9-8-7-6-24/

modify it to fit your use.

Share this post


Link to post
Share on other sites

Oh, I have interest in this question.Xisto-file-no-833.html is somewhat too simple and means nothing.Vxworks do this way very well, but I still don't know how it works.Waiting for your solution.

Share this post


Link to post
Share on other sites

I know with dynamically linked libraries you can get a function reference by passing a string that contains the function name. So you just compile the functions as a DLL it will work.

Share this post


Link to post
Share on other sites

but params,

how to give the correct params?

 

like:

func("asdf",1)

 

I know with dynamically linked libraries you can get a function reference by passing a string that contains the function name. So you just compile the functions as a DLL it will work.

43426[/snapback]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.