Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everyone,
I'm beginner and I need a little help. I have to make RPN (postfix) calculator using stack which is implemented by singly linked list in C. Now I found that but in C++ and I'm having trouble translating it to C. Can you help me getting things to work? I have started from http://www.mediafire.com/view/q833x5sic8eq4sx/from_c__.txt and using a little code from http://www.mediafire.com/view/ewz9so6999ig5x0/using_c.txt I get to http://www.mediafire.com/view/qesca0cg0vzjzac/to_this_in_c.txt code and it debugs but when I enter anything in console it crashes and gives me some assembly code I'm using VS C++ 2010. Please help me to fix this, I can't find what's wrong.
Posted
Updated 14-Mar-15 11:46am
v2
Comments
Sergey Alexandrovich Kryukov 14-Mar-15 17:45pm    
If your school or somebody requires you to write code in C, write it in C, don't get into "C++ to C translation problem". You are supposed to do you job by yourself, and to write code, not to search for code written by other people, otherwise you won't be able to learn how to do your job. If you need some help, please show what you have done, and ask the question on your problems in detail.
—SA

1 solution

As Sergey said, don't copy code from one language when you are trying to learn another.
You will end up in a conversion mess, as you already noticed.

It is better you try to find examples in C and go from there.
If your first obstacle is a linked list, you can take a look at the following sites:
g/en/Linked_lists" target="_blank" title="New Window">^]

Lesson 15: Singly linked lists in C[^]

Linked lists in C[^]

Good luck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900