In function 'int main()':
83:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
89:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
97:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
105:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
112:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
119:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
126:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
133:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
141:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
148:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
155:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
162:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
169:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
176:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
183:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
75:6: warning: unused variable 'time' [-Wunused-variable]
77:34: warning: unused variable 'k' [-Wunused-variable]
91:12: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
107:12: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
114:12: warning: 'd' may be used uninitialized in this function [-Wmaybe-uninitialized]
128:12: warning: 'e' may be used uninitialized in this function [-Wmaybe-uninitialized]
135:12: warning: 'f' may be used uninitialized in this function [-Wmaybe-uninitialized]
143:12: warning: 'g' may be used uninitialized in this function [-Wmaybe-uninitialized]
157:12: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
164:12: warning: 'j' may be used uninitialized in this function [-Wmaybe-uninitialized]
185:12: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
If you're having trouble with initializing a variable, the solution would simply be to initialize them.
You are pushing the char variables a,b,c etc into the queue, but they're garbage. They have no value, you havent given them any value so they're value of garbage. when you do Q.push(c); what are you pushing into the queue? what is "c" equal to?