如题.
解决方案 »
- GDI写字 靠右对齐
- 关于VC6.0消息处理过程的一点小疑问
- 在custom control中响应键盘消息
- 加急!!搞了两天了,mfc以ADO方式连接Oracle数据库,总连接不上;
- 我的程序通过ODBC可以访问SQL SERVER和ACCESS和数据库,但有些SQL语句不能通用?
- 【求助:自己开的一个线程每次大约能获得多长的运行时间?----在线等】
- 控件内部的全局函数可以调用fopen函数吗?100分相送!急阿
- 请问如何从进程ID获得该进程拥有的窗口的句柄
- 近期本人将提供优秀电子书交流的FTP空间
- 弹出式菜单的菜单项是怎样和一项操作联结起来?弹出式菜单是程序生成,不是载入资源。
- 请问在公安单位搞计算机软件的有发展的前途么??(见者有分)
- 多线程问题
例:
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
void main()
{
string file_name;
cout<<"please enter a file name: ";
cin>>file_name;
ifstream infile(file_name.c_str());
if (!infile)
{
cerr<<"oops,unable to open file"<<file_name
<<"- -bailing out!\n";
exit(-1);
}
else
{
string buffer;
infile>>buffer;
cout<<buffer.c_str()
<<"\n";
}}