使用两个 cliext::stack.. 的问题
stack<T^>^ pfn = gcnew stack<T^>(); - compiles
stack<K^>^ pf = gcnew stack<K^>(); - 93 compile errors.
问题是什么?
USE Generics::Stack 为什么两台机器的声明错误很多?
private: System::Void btn_add_Click(System::Object^ sender, System::EventArgs^ e)
{
fileOperation^ fw = gcnew fileOperation();
if (comboBox1->SelectedIndex == 0 )
{
flyBird^ f = gcnew flyBird();
System::Collections::Generic::Stack<flyBird^>^ p = gcnew System::Collections::Generic::Stack<flyBird^>();
f->birdName=txt_name->Text;
f-> year = textBox1->Text;
f->vess = txt_tmp1->Text;
f->sreda = txt_tmp2->Text;
p->Push(f);
}
else
{
System::Collections::Generic::Stack<noflyBird^>^ p1 = gcnew System::Collections::Generic::Stack<noflyBird^>();
noFlyBird^ f = gcnew noFlyBird();
fn ->birdName=txt_name->Text;
fn ->year = textBox1->Text;
fn ->pitanie = txt_tmp1->Text;
fn ->domoshnie = txt_tmp2->Text;*/
}
}
警告 1 警告 C4138:在注释 c:\documents and settings\bobilev\my documents\visual studio 2010\projects\burd\burd\Form1.h 275 1 burd 之外找到“*/” 错误 6 错误 C2143:语法错误:缺少 ';' 在'}'之前\我的文档\visual studio 2010\projects\burd\burd\Form1.h 277 1 burd 错误 7 错误 C2143:语法错误:缺少 ';' 在'}'之前 ments\visual studio 2010\projects\burd\burd\Form1.h 281 1 burd 错误 11 错误 C2143:语法错误:缺少 ';' 在'}'之前我的文档\visual studio 2010\projects\burd\burd\Form1.h 293 1 burd 错误 12 错误 C2143:语法错误:缺少 ';' 在'}'之前 c:\我的文档\visual studio 2010\projects\burd\burd\Form1.h 297 1 burd