I am getting errors compiling a C++ class, it relates to a Struct which is to be returned from a method. I have striped the code down to the minimum and still get the errors. I am using Visual Studio 6.0.
Code
// TestClass.cpp: implementation of the TestClass class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "TestClass.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
TestClass::TestClass()
{
}
TestClass::~TestClass()
{
}
ProductInfo TestClass::GetProdInfo()
{
ProductInfo PI;
return PI;
}
// TestClass.h: interface for the TestClass class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TestClass_H__081E411D_44F9_4E0B_9FE7_CF6F708BE769__INCLUDED_)
#define AFX_TestClass_H__081E411D_44F9_4E0B_9FE7_CF6F708BE769__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class TestClass
{
public:
struct ProductInfo
{
char cCode;
char cItem[20];
long lValue;
};
public:
TestClass();
virtual ~TestClass();
private:
ProductInfo GetProdInfo();
};
#endif // !defined(AFX_TestClass_H__081E411D_44F9_4E0B_9FE7_CF6F708BE769__INCLUDED_)
Errors received
Compiling...
TestClass.cpp
C:\Work\TestStruct\TestClass.cpp(22) : error C2143: syntax error : missing ';' before 'tag::id'
C:\Work\TestStruct\TestClass.cpp(22) : error C2501: 'ProductInfo' : missing storage-class or type specifiers
C:\Work\TestStruct\TestClass.cpp(22) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
TestStruct.exe - 3 error(s), 0 warning(s)
Any ideas why i am getting these errors?
Thanks