How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask LogicPro Your Own Question
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 12718
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

write a c program to implement a stack of integers as a linked

This answer was rated:

write a c program to implement a stack of integers as a linked list.
using the operations push, pop, show and exit.
push X – push the integer X onto the stack
pop – returns the value held at the top of the stack and removes it from the stack
show – display the stack in a horizontal format with top and bottom clearly marked (top on the right)
quit – exit the program
Testing:
Create a file pointer to read from a testdata file
example:
push 1
push 2
push 3
show
pop
show
quit
Hi,
Welcome back
Thank you for asking me
Please review previous answer.
I will work on it after that.
Customer: replied 3 years ago.

OK thanks

Welcome
Download this zip file Stack_LinkedList_C_testData.zip
Unzip to get required files.
Put both files in the same folder.

You can ask me again using "For LogicPro only" at the start of your questions like you did to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help.
Thank you for using JustAnswer!

Customer: replied 3 years ago.

hello


I keep getting errors in the code its saying:


assignment from incompatible pointer type,


and also dereferencing pointer to incomplete data

Can you provide me output screenshot?
Also which C compiler are you using?
Customer: replied 3 years ago.

file://localhost/Users/brianaguilar/Desktop/Screen%20Shot%202013-05-13%20at%2011.28.15%20PM.png


 


here is a screenshot


and i am using unix but windows also works

upload screenshot to http://wikisend.com and post download link here.
Customer: replied 3 years ago.

http://wikisend.com/download/130924/Screen Shot 2013-05-13 at 11.28.15 PM.png


 

THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
LogicPro and other Homework Specialists are ready to help you
Customer: replied 3 years ago.

so for example in function show you have a line that has head = head->next


 


and that is where the error is pointing to..

There is no error, and same code has been used in the previous program also.

 

Try to run it on Windows.

 

Customer: replied 3 years ago.

I got it to run. I was doing some random testing on it and I was trying to do this :


show
push 1
push 2
push 3
push 4
show
push 5
push 6
push 7
push 8
show
pop
show
pop
push 9
pop
push 10
pop
pop
pop
pop
pop
pop
pop
pop
show
pop
show
push 11
push 12
show
quit


 


it seems i get a segmentation default i cant figure out why, is it because there is a certain limit but there is no define or size?

Please elaborate "i get a segmentation default"

Did you run on windows?
Customer: replied 3 years ago.

http://wikisend.com/download/996236/Screen Shot 2013-05-14 at 4.19.16 PM.png


 


here is a screenshot, it does all the assignments but it stops after the push 10 and the eight pops. it does not get to the quit assignment.

Requirements says "i am using unix but windows also works"

It i running fine on Windows. Please check it on windows
Customer: replied 3 years ago.

I got it to work thank you for your help

Great and Welcome :)

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions on original requirements at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Related Homework Questions