Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Try This, C problem
cse-icons
post Jan 25 2005, 07:16 AM
Post #1


Super Member
*********

Group: Members
Posts: 351
Joined: 19-October 04
From: India
Member No.: 1,824



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.
Go to the top of the page
 
+Quote Post
LuciferStar
post Jan 25 2005, 10:31 AM
Post #2


Advanced Member
*******

Group: Members
Posts: 114
Joined: 9-August 04
From: Suzhou Jiangsu China
Member No.: 743



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.
Go to the top of the page
 
+Quote Post
yomi
post Jan 26 2005, 04:45 AM
Post #3


Engineer
*****

Group: Members
Posts: 78
Joined: 25-July 04
From: China
Member No.: 204



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.
Go to the top of the page
 
+Quote Post
s243a
post Jan 26 2005, 05:07 AM
Post #4


Super Member
*********

Group: Members
Posts: 408
Joined: 7-December 04
From: Nova Scoita, Canada
Member No.: 2,604



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.
Go to the top of the page
 
+Quote Post
yomi
post Jan 26 2005, 04:06 PM
Post #5


Engineer
*****

Group: Members
Posts: 78
Joined: 25-July 04
From: China
Member No.: 204



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

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Did You Face Problem Opening Pdf With Firefox?(15)
  2. 60 Seconds Countdown That Shutdown The Pc(15)
  3. Problem Installing Sims 2 Nightlife(26)
  4. I Have A Girl Problem Here(27)
  5. Upload Component - Failed(6)
  6. Problem With Page Redirect(8)
  7. Php Header Problem(11)
  8. Remote Assistance Problem(9)
  9. Laptop Keyboard Problem(8)
  10. Skype / Xampp Port Conflict(5)
  11. Dandruff Problem(29)
  12. Sharing Files And Printer Between Windows Vista And Xp(9)
  13. Pop-up Virus / Trojan Problem(10)
  14. Itunes Problem!(1)
  15. How Many More Times Will I Have To Post About This?(11)
  1. Youtube People That Do Not Respect Other Opinions(7)
  2. A Problem With Ftp Clients(9)
  3. Domain Problem : This Is Important..(0)
  4. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  5. Terminating Hosting Problem(1)
  6. Problem With My Girlfriend Family, Need Suggestions For Action(2)
  7. Firefox 3 Cookies Problem(4)
  8. Hosting Credits Problem? [resolved](9)
  9. Counter Strike Problem(2)
  10. Problem With The Trap17 Forum(4)
  11. Attachment Problem In Pmwiki(0)
  12. What Is My (power) Problem?(4)
  13. Problem With Hosting(4)


 



- Lo-Fi Version Time is now: 6th October 2008 - 11:47 PM