C++新手循环问题,不知哪错了,编译不通过
#include <iostream>using namespace std;
class CDrawArray
{
public:
void DoDraw(int num);
}
void CDrawArray::DoDraw(int num)
{
for(int i = 0; i < num; i++)
{
for(int j = 0;j <= i; j++)
cout<<'*';
cout<<'\n';
}
}
int main()
{
int num = 5;
CDrawArray myDraw;
myDraw.DoDraw(num);
return 0;
} class CDrawArray
{
public:
void DoDraw(int num);
}; //这里少个分号 xieglt 发表于 2020-11-15 10:42
太感谢了,我长时间没学C++,发现基础全忘了。
页:
[1]