请帮忙举例说明MFC编程中对栈的简单应用

解决方案 »

  1.   

    请就一个简单的例子可以吗,MFC下用到栈时需要声明一些东西吗?
      

  2.   

    不用吧。
    反正new是在堆中分配的
      

  3.   

    我遇到的具体问题如下,希望大家帮助看看
    #include "stdafx.h"
    #include "tigeryufa.h" 
    #include "Finsert.h" 
    #include "tigerleft.h" 
    #include "tigeryufaDlg.h" 
    #include<stack> 
    using namespace std;
    #ifdef _DEBUG 
    #define new DEBUG_NEW 
    #undef THIS_FILE 
    static char THIS_FILE[] = __FILE__; 
    #endif 
    .... 
    .... 
    .... 
    void CFinsert::Ondaoru() 

    // TODO: Add your control notification handler code here 
    stack<char> s; 

    error: 
    C:\Documents and Settings\tiger85\桌面\tigeryufa\Finsert.cpp(337) : error C2065: 'stack' : undeclared identifier 
    C:\Documents and Settings\tiger85\桌面\tigeryufa\Finsert.cpp(338) : error C2065: 'mystack' : undeclared identifier 
    C:\Documents and Settings\tiger85\桌面\tigeryufa\Finsert.cpp(338) : error C2146: syntax error : missing ';' before identifier 'shed' 
    C:\Documents and Settings\tiger85\桌面\tigeryufa\Finsert.cpp(338) : error C2065: 'shed' : undeclared identifier 
    Error executing cl.exe.