Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    97
  • comments
    98
  • views
    50909

Yar.

Sign in to follow this  
caffeineaddict

123 views

The first thing that I did today was go vote. It was the first election i've voted for, first time i've been eligible to vote for president, though I think i've been eligible for a few local elections. Anyway, that's over with. It was cool if for no other reason than I got to play with a touchscreen for a few minutes [lol]. I love those things.

I've got to code up a homework for school between now and Friday. It's a stack example (using a linked list), so i've got to push and pop and all of that fun stuff to evaluate postfix expressions. The only real problem that I can see is how to get the integers so that they can be evaluated as numbers.

The format for an expression is as follows:

3 45 + .


Now, getting a single character isn't hard, so I push it onto the stack, but when it comes to more than 1 digit number, it pushes each individual digit separately. Then I handle the operator.

Maybe I need to test whether the incoming "character" is a number or an operator and read it as an int or char accordingly?
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!