can someone please tell me why this is giving me a segmentation fault? I am sure it has something to do with the first line. Thanks!!
int main()
{
StackType<char> temp;
char sym;
cin >> sym;
while (sym != '#')
{
if (sym == '{' || sym == '(')
{
temp.push(sym);
}
else if (sym == ')' || sym == '}')
{
temp.pop();
}
cin >> sym;
}
cout << endl;