Thread: C++ to C

  1. #1
    Registered User
    Join Date
    Mar 2015
    Posts
    1

    C++ to C

    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 <from c++.txt> and using a little code from <using c.txt> I get to <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.
    P.S. code is in attachment

  2. #2
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    Maybe you should just post just the relevant code where you have a question. Preferably post it in a "code" tag and not as a bunch of attachments. Most people here don't want to download one or more attachments and work on doing this task for you. Instead if you post what you have so far with a relevant code sample, along with what you've attempted so far, what error messages you got, where the program crashed etc. With those details someone here may be motivated/able to offer you some advice or suggestions.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,667
    > Now I found that but in C++
    Yeah, this is pretty much where you went wrong.

    You're never going to learn how to code properly if you just use google and then do hatchet jobs on whatever you find, then hope some kind soul on a forum will fix up the mess for you.

    It's OK to look at the code for ideas and inspiration, but you need to actually write your own version from scratch, so you get the full benefit of the experience.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed