/* Hello Friends ... 私は C++ の初心者です */
#include<iostream>
#include<conio.h>
using namespace std;
class A
{
protected:
int a,b;
public:
A():a(0),b(0){ }
};
int main()
{
A *x;
x = new A[20];
delete []x;
getch();
return 0;
}
私の質問は、 for ループを使用せずに配列を動的に作成しながら、いくつかのデフォルト値を渡すことができるように、クラス A でパラメーター化されたコンストラクターを作成する方法です。また教えてください、それらの値を渡す構文は何ですか?