Data Structures Using C++: Using the Stack to create a RPN (post-fix notation) Calculator

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 41

  • @markksantos
    @markksantos 2 года назад +1

    THIS IS AMAZING! THANKS PLEASE MAKE MORE VIDEOS LIKE THIS!

  • @airplanefreak27
    @airplanefreak27 11 лет назад +2

    This is EXTREMELY helpful!

  • @georgepatsias
    @georgepatsias 8 лет назад +1

    Very helpful!!! Thanks very MUCH!

  • @LukusGames
    @LukusGames 3 года назад

    What a fantastic video

  • @AbdelrahmanRashed
    @AbdelrahmanRashed 8 лет назад

    Thanks , your program really helped me in writing on my Android Calculator , Thanks again man.

  • @ReelLearning
    @ReelLearning  12 лет назад

    In general you should declare variables in the narrowest scope as possible - I don't always follow this rule myself, but I did in this case. A good compiler will not produce anymore overhead for declaring the num variable inside the loop. As far as using a try/catch, you may be right... I don't remember my thought process at the time, but maybe I planned to do a separate video on exceptions and the try/catch.

  • @_ZeRoYa_
    @_ZeRoYa_ 6 лет назад

    Thank you very much for a great video and your clear explanation!

  • @EmZvr
    @EmZvr 11 лет назад

    Very good explanation, thank you.

  • @jamesbones1668
    @jamesbones1668 6 лет назад

    outstanding. thanks.

  • @danielmejia4054
    @danielmejia4054 2 года назад

    Sooo good

  • @dbf8014
    @dbf8014 5 лет назад +1

    when you just compiled the program
    what happens if i wanna do
    1.2
    - (subtract)
    2.9
    q (quit)
    ???

  • @badpeq
    @badpeq 11 лет назад

    This helped a lot, thanks!

  • @thinkb4uclick_780
    @thinkb4uclick_780 6 лет назад

    thank you for this vid! it helps alot 😊

  • @andeluuledna
    @andeluuledna 9 лет назад

    thanks a lot!

  • @Shockszzbyyous
    @Shockszzbyyous 9 лет назад

    so every time isOperator is called the string will be allocated space and the symbols loaded? or is the compiler smart enough to see that and just load it once outside the scope of the program and just use a pointer for it ? or am i totally getting it wrong here :D

  • @RootForums
    @RootForums 5 лет назад

    You sound like Bill Gates...
    Thank you for the tutorial !!

  • @rady90
    @rady90 10 лет назад

    What if you divide by zero? Goodbye processor?

  • @kim15742
    @kim15742 8 лет назад

    Is there no other way of translating the operator char into an actual operator? I have those long else if stacks...

    • @aggbak1
      @aggbak1 7 лет назад

      use a map that has a string for a key and a pointer to a function with two doubles as arguments and returns a double.

  • @shojibmahmud9667
    @shojibmahmud9667 6 лет назад

    If I want to do some operations with Trigonometric operators then what should to do?

  • @MegaBdboy
    @MegaBdboy 7 лет назад

    How can i transform this code in prefix polish notation not revers ?

  • @kevinozocak4349
    @kevinozocak4349 7 лет назад

    how can i change the programm to use also e function ? example: 3e-2... ?

  • @insect212
    @insect212 10 лет назад

    Why use stack instead of vector? Vector gets better performance.

    • @jpkfox
      @jpkfox 10 лет назад +1

      Performance does not need to be considered here as the number of calculations is small and is human driven program. Trimming programs is normally not needed until there is a real need for it. Makes code better structured by using stack I would say. So I think I would also use stack.

    • @insect212
      @insect212 10 лет назад

      jpkfox Ah I see.

    • @jpkfox
      @jpkfox 10 лет назад

      Brock X
      Because the argument could be set also that making the program even faster we could add some assembly code in it instead of C++ code. Yes it would be even faster, but it would be harder to read for programmers. And that is the whole purpose of C++: to make code better structured and more readable. Sometimes it means a bit worse performance, but we sacrifice it a bit sometimes to get better looking code. But again it depends.. if performance was really needed, then yes we would need to trim it and do it even if the code looks less structured.

    • @insect212
      @insect212 10 лет назад

      jpkfox I'm glad I chose to use vectors then. I am making a program that requires millions of calculations, so performance is important.

    • @jpkfox
      @jpkfox 10 лет назад

      Brock X Yes sure if its millions of operations per second, then must read the documentation and check which is fastest. But with this calculator its not the case... its only couple of operations per second required.

  • @majesticbarrack5506
    @majesticbarrack5506 8 лет назад

    is it works on variables?

  • @TheWeepingCorpse
    @TheWeepingCorpse 9 лет назад +2

    why do you say pound include instead of hash include. # = hash, £ = pound.

    • @Witteplaag
      @Witteplaag 7 лет назад +7

      Can't be certain, but I believe it's an American thing. I knew "#" all my life as "pound" until twitter came along.

    • @TheBoomersauce
      @TheBoomersauce 6 лет назад +1

      Americans dont have £ on our keyboards so we can call # pound without a name conflict. As to why we call it pound i think it has something to do with telephones

    • @sirkastic
      @sirkastic 5 лет назад +3

      Because we aren't all British Wankers

  • @irvansuryadi3640
    @irvansuryadi3640 6 лет назад

    may i get the codde

  • @matusivanovic5992
    @matusivanovic5992 10 лет назад

    heya i wrote EVRYTHIN like in dis wideo, and 5 4 + printed out 1.25 WOOOT