User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 391,557 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,694 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 3028 | Replies: 6 | Solved
Reply
Join Date: Jun 2007
Posts: 2
Reputation: coolguy_003 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
coolguy_003 coolguy_003 is offline Offline
Newbie Poster

Help Stack implementation using function pointers in C

  #1  
Jun 28th, 2007
Hi,
I did the stack implementation using arrays and i would like to do it with function pointers but i have no idea. If anyone could help by illustration that would be great as function pointers is pretty difficult for me!

Thanks in advance.
coolguy
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore, India
Posts: 535
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Rep Power: 4
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: Stack implementation using function pointers in C

  #2  
Jun 29th, 2007
Here is a link that gives you links for function pointer tutorials.
http://www.google.com/search?q=funct...inter+tutorial
Given you've already implemented stack, you already know that part. If you are looking for something more specific, you'll have to make the question specific.
Are you Agile.. ?
Reply With Quote  
Join Date: Jun 2005
Location: Troy
Posts: 1,276
Reputation: Rashakil Fol has a spectacular aura about Rashakil Fol has a spectacular aura about 
Rep Power: 7
Solved Threads: 36
Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Salamander Man

Re: Stack implementation using function pointers in C

  #3  
Jun 29th, 2007
I am very confused. How in the world are you going to implement a stack using function pointers?
Reply With Quote  
Join Date: Jun 2007
Posts: 8
Reputation: bobs360 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
bobs360 bobs360 is offline Offline
Newbie Poster

Re: Stack implementation using function pointers in C

  #4  
Jun 29th, 2007
Man you surely need prayers not just answers, I wish I could help, My thoughts with you!
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,774
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Stack implementation using function pointers in C

  #5  
Jun 29th, 2007
> I am very confused. How in the world are you going to implement a stack using function pointers?
I guess he means by using dynamic memory allocation, using a node structure which holds the data as well as the pointer to the next node.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Jun 2005
Location: Troy
Posts: 1,276
Reputation: Rashakil Fol has a spectacular aura about Rashakil Fol has a spectacular aura about 
Rep Power: 7
Solved Threads: 36
Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Salamander Man

Re: Stack implementation using function pointers in C

  #6  
Jun 29th, 2007
That doesn't involve function pointers though

Mentioning function pointers must be a sign of being completely lost, since there's only a finite constant set of values a function pointer can attain in any given executable; you might as well implement a stack using a bounded set of integers, or something crazy like that.
Reply With Quote  
Join Date: Jun 2007
Posts: 2
Reputation: coolguy_003 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
coolguy_003 coolguy_003 is offline Offline
Newbie Poster

Re: Stack implementation using function pointers in C

  #7  
Jun 29th, 2007
Hi thekashyap,
Your links are a saver. I tried previously for links but could get only two.
I was just trying to do basic stack operations of push and pop.
Thanks again for the links and also for the quick reply.

coolguy
Last edited by coolguy_003 : Jun 29th, 2007 at 8:15 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 9:44 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC