[分享]c++小型通讯录程序
发个简单的通讯录程序,,,刚学不久,,用来练一下类的那节内容,,呵呵,,,不知道我用的是不是面向对像的方法,,,,还一头暮水呢,,^_^;

比如你的"不能连接数据库"这个判断应该在加载主界面前进行.. 还有对错误的选项输入应进行提示...etc..
#include <iostream>
using namespace std;
int main()
{
int x;
while (cin >> x)
{
try
{
if (x == 0)
{
char *p="error";
throw p;
}
}
catch (char *str)
{
cout << str << endl;
continue;
}
}
return 0;
}
给你这段代码,你试试看