tags:

views:

381

answers:

4

I'm using Visual C# to program an RPN calculator using Stack. Problem is I don't know how to do this. I'm using System.Collections.Generic, but

Stack s = new Stack();

generates the error "Using the generic type 'System.Collections.Generic.Stack' requires '1' type arguments"

I'm pretty clueless here. Thanks for the help.

+1  A: 

You need to specify the type of the elements that you will store on your stack, for example a stack of integers:

Stack<int> s = new Stack<int>();
CMS
+4  A: 

Try this

Stack<int> s = new Stack<int>();

Replace int with whatever type you are storing in the stack.

JaredPar
A: 

All right. I did that, with double, same error...?

maybe it would help to post your latest (updated) code, and the exact error you're getting
Charlie
A: 

Ha. Just kidding. Fixed.