Jul 20, 2008

Try This - C problem

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming

free web hosting

Try This - C problem

cse-icons
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.

Reply

LuciferStar
QUOTE(cse-icons @ Jan 25 2005, 07:16 AM)
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.
*


You may try something like function pointer.
I have an article about this:
http://www.trap17.com/forums/trap17-file-no-833.html
modify it to fit your use.

Reply

yomi
Oh, I have interest in this question.
trap17-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.

Reply

s243a
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.

Reply

yomi
but params,
how to give the correct params?

like:
func("asdf",1)

QUOTE(s243a @ Jan 26 2005, 05:07 AM)
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.
*


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics
Looking for c, problem

Searching Video's for c, problem
advertisement



Try This - C problem



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE