Can you declare a stack globally?
Code:stack< int > stk;
Can you declare a stack globally?
Code:stack< int > stk;
Last edited by CASHOUT; 07-14-2013 at 08:10 AM.
Sure.
Try it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Sure, you read your book and you learn all about reference parameters.
Eg.
Code:void foo ( stack<int> &mystack ) { mystack.push(42); }
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.