ヘルプ!C++ は初めてです... このヘッダー ファイルを修正するにはどうすればよいですか?
#pragma once
class MyCls2
{
private:
int _i, _j;
public:
MyCls2(int i, int j) : _i(i),
_j(j)
MyCls2(); // error: expected a '{'
~MyCls2(void);
};
これは、MS VC 2010 のエラーです。
エラー: '{' が必要です
助けてくれてありがとう、私は今欲しいものを手に入れました:
.h:
#pragma once
class MyCls2
{
private:
int _i, _j;
public:
MyCls2(int i, int j) ;
MyCls2();
~MyCls2(void);
};
.cpp:
#include "StdAfx.h"
#include "MyCls2.h"
MyCls2::MyCls2()
{
}
MyCls2::MyCls2(int i, int j) : _i(i),
_j(j)
{
}
MyCls2::~MyCls2(void)
{
}