Stack Program
Nov 4, 2014 at 10:37pm UTC
For some reason I can't get this program to run. This is directly from my textbook. My compiler doesn't like the "stack.s" or anything with .s Any suggestions on how to fix this?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#include <iostream>
#include "stack.h"
using namespace std;
using namespace stackwolanski;
int main()
{
stack.s;
char next, ans;
do
{
cout << "Enter a word" ;
cin.get(next);
while (next != '\n' )
{
s.push(next);
cin.get(next);
}
cout << "Written backward that is: " ;
while ( ! s.empty())
cout << s.pop();
cout << endl;
cout << "Again?(y/n): " ;
cin >> ans;
cin.ignore(10000, '\n' );
} while (ans != 'n' && ans != 'N' );
return 0;
}
Nov 4, 2014 at 10:43pm UTC
Remove the dot from line 8.
Nov 4, 2014 at 11:19pm UTC
When I do that it says "Use of undeclared identifier "stacks"
Nov 4, 2014 at 11:27pm UTC
You need space between "stack" and "s".
Topic archived. No new replies allowed.