problèmes dans l'utilisation de deux cliext :: .. pileC++ CLI deux pile <>
stack<T^>^ pfn = gcnew stack<T^>(); - compiles
stack<K^>^ pf = gcnew stack<K^>(); - 93 compile errors.
Quel est le problème?
USE Generics :: Stack Pourquoi la déclaration des deux machines est-elle une erreur?
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;*/
}
}
Warning 1 warning C4138: '*/' found outside of comment c:\documents and settings\bobilev\my documents\visual studio 2010\projects\burd\burd\Form1.h 275 1 burd Error 6 error C2143: syntax error : missing ';' before '}' \my documents\visual studio 2010\projects\burd\burd\Form1.h 277 1 burd Error 7 error C2143: syntax error : missing ';' before '}' ments\visual studio 2010\projects\burd\burd\Form1.h 281 1 burd Error 11 error C2143: syntax error : missing ';' before '}' my documents\visual studio 2010\projects\burd\burd\Form1.h 293 1 burd Error 12 error C2143: syntax error : missing ';' before '}' c:\my documents\visual studio 2010\projects\burd\burd\Form1.h 297 1 burd
Je pense que vous devez ajouter une balise CLI car cela n'a aucun sens en C++ standard. – juanchopanza
Sans voir les erreurs, il est impossible de répondre, mais pourrait avoir quelque chose à voir avec les différences entre 'T' et' K'? –
les deux premières erreurs dans l'erreur de liste: C3156: 'fileOperation :: FileReader :: Form1': vous ne pouvez pas une définition locale d'un type mangé erreur c2653: Form1: est un nom de classe ou espace de noms – user1458331