cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Stack characters
Stack characters
Nov 16, 2008 at 4:20am UTC
jonestsai
(6)
Is there a way to stack multiple characters?
Example:
// stack::top
#include <iostream>
#include <stack>
using namespace std;
int main ()
{
stack<char> mystack;
mystack.push('abc'); <---- stack only allows 1 character
cout << "mystack.top() is now " << mystack.top << endl;
system ("PAUSE");
return 0;
}
Any answers would be appreciated.
Nov 16, 2008 at 4:43am UTC
jsmith
(5804)
Use stack<string> instead.
Topic archived. No new replies allowed.