私は私は適切な解決策で答える私を与えるこのquestion.Pleaseに適切solution.Iも追加のエラー画像を見つけることができませんでしたよC++ で初心者レベルの学生です助けてください。このシンプルなC++クラスプログラムで何が問題になっていますか?
#include <iostream>
#include <conio.h>
class test
{
int no;
static int count;
public:
void getval (int);
void dispcount (void);
};
void test:: getval(int x)
{
no = x;
cout << "Number = " << no << endl;;
count++;
}
void test::dispcount(void)
{
cout << "Counten = " << count;
}
int test::count;
int main()
{
test t1,t2,t3;
t1.dispcount();
t2.dispcount();
t3.dispcount();
t1.getval(100);
t2.getval(200);
t3.getval(300);
t1.dispcount();
t2.dispcount();
t3.dispcount();
getch();
return 0;
}
適切な解決策を見つけるには、問題を特定する必要があります。あなたはそうしましたか? –
あなたの質問に、このような質問に読みにくい画像を含めないでください。エラーメッセージをプレーンテキストとして含める必要があります。 C++の初心者のために、あなたが学ぶ必要がある最高のスキルは、他のみんながあなたを理解できるようにあなたの問題を伝える方法です。 –
'std :: cout << ...'を使います。 –