请问这样写的为什么不可以呢?
#include"stdafx.h"
#include <string.h>
#include <iostream>
using namespace std;
class Dogs
{
public:
Dogs()
{
m_dogName = "white";
}
Dogs(string _name)
{
m_dogName = _name;
}
string getName()
{
return m_dogName;
}
private:
string m_dogName;
};
int main(void)
{
Dogs dog1("black");
Dogs dog2;
cout << dog1.getName() << endl;
cout << dog2.getName() << endl;
system("pause");
return 0;
}

提示我不能输出,求大神解答