0
之前我有以下問題,我有一個具有類B實例的類A,而類B具有類A的實例。在VisualStudio 2013中給我提供了錯誤「錯誤C2143:語法錯誤:失蹤 ';' '^'之前「下面是班級代碼。由於事先錯誤C2143:語法錯誤:缺少';'在'^'
#include "stdafx.h"
#include "BAsterNode.h"
using namespace System;
using namespace System::Collections::Generic;
ref class BAsterInfo
{
private:
IComparable^ info;
BAsterNode^ enlaceMayores; /* error C2143 */
public:
IComparable^ GetInfo();
void SetInfo(IComparable^);
BAsterNode^ GetEnlaceMayores();
void SetEnlaceMayores(BAsterNode^ enlaceMayoresP);
};
和第其它類
#include "stdafx.h"
#include "BAsterInfo.h"
using namespace System;
using namespace System::Collections::Generic;
ref class BAsterNode
{
private:
BAsterNode^ enlaceMenores;
List<BAsterInfo^>^ listaInformacion;
int Find(BAsterInfo^ info);
public:
List<BAsterInfo^>^ GetListaInfo();
void SetListaInfo(List<BAsterInfo^>^ listaInfoP);
BAsterNode^ GetEnlaceMenores();
void SetEnlaceMenores(BAsterNode^ enlaceMenoresP);
};