堆栈和队列容量的溢出 (c++)

Overfilling of Stack and Queue Capacity (c++)

经过数小时的研究、阅读、查看示例代码……我被卡住了(或被炸了)。我有一个内存泄漏,它不会将任何内容转储到我的堆栈和队列 'lists' 中。前提是我正在尝试通过使用 Stacks & Queues 来创建查找单词或短语是否为回文。当只使用一个词来测试我的程序时,堆栈和队列 'lists' 已满。我可以为一个词修复它……但它需要为一个短语工作。

#include <iostream>
#include <ostream>
#include <stdlib.h>
using namespace std;

#include "Stack.h"
#include "stack.cpp"
#include "Queue.h"
#include "queue.cpp"

void blankspace(char *s, char *t);

int main(void)
{
    Stack palinS;
    Queue palinQ;
    char mess[80];
    char bmess[80];
    int i;
    int n;
    int j;
    i = 0;
    n = 0;
    j = 0;

    cout << "Please enter a word or phrase: ";
    cin >> mess;

    blankspace(mess, bmess);

    while (bmess != NULL){
        palinS.push(bmess[i]);
        palinQ.enqueue(bmess[i]);
        i++;
    }

    n = sizeof(bmess);
    while (!palinS.empty()){
        palinS.top();
        palinQ.front();
        if (palinS.top() == palinQ.front())
            j++;
        palinS.pop();
        palinQ.dequeue();
    }

    if (j++ == n){
        cout << "  You have a palindrome!!!";
    }
    else {
        cout << "  SORRY... The word/phrase is NOT a palindrome.";
    }

    return (0);
}

void blankspace(char *s, char *t)
{
    while (*s != '[=10=]'){
        if (*s != ' ') *t = *s;
        t++;
        s++;
    }

@RyanP 这个答案真的值得称赞。
在查看他的建议后,当我将代码固定为...

while (bmess [i] != '/O'){
    palinS.push(bmess [i]);
    palinQ.front(bmess [i]);
    i++;
    }

这解决了我无休止的 Stack & Queue 'list' 创建问题。感谢大家的评论!