Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #72.7K
Ranked #4K
~94 People Reached
Favorite Forums
Favorite Tags
c++ x 2
Member Avatar for NoUserNameHere

Not getting any compile error, but I'm getting an output that looks like: -858993460 5 4 3 2 Instead of 5 4 3 2 1. What am I doing wrong? [CODE]#include <iostream> #include <stack> using namespace std; template <typename T> void reverse(stack<T> &sk) { stack<int> tempStack; while(!sk.empty()) { tempStack.push(sk.top()); sk.pop(); …

Member Avatar for tharumax
0
94