关于CStdioFile的使用问题
在win32控制台调试如下程序
#include "stdafx.h"
#include <afx.h>
//#include <iostream>
//using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
CString str;
int a,b;
/* CStdioFile fBio;
fBio.Open(LPCTSTR("FBio.Dat"),CFile::modeCreate|
CFile::modeWrite|CFile::typeText);
a=b=1;
cout<<a<<endl;
str.Format(_T("%d\n"),a);
fBio.WriteString(LPCTSTR(str));
while (a<100)
{
cout<<a<<endl;
//str.Format("%d\n",a);//“void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [4]”转换为“const wchar_t *”
str.Format(_T("%d\n"),a);
fBio.WriteString(LPCTSTR(str));
a=a+b;
b=a-b;
}
fBio.Close();*/
getchar();
return 0;
}
怎么也调试通不过。原来
CStdioFile定义 只能在mfc中使用
头大。
关于CStdioFile的使用问题的更多相关文章
- CStdioFile CString 读写中文
TCHAR* old_locale = _tcsdup( _tsetlocale(LC_CTYPE,NULL) ); _tsetlocale( LC_CTYPE, _T("chs" ...
- MFC 文件按行读写 CStdioFile
//写文件 CStdioFile file; file.Open("test.txt",CFile::modeCreate|CFile::modeReadWrite); file. ...
- CStdioFile
CStdioFile类的声明保存再afx.h头文件中. CStdioFile类继承自CFile类,CStdioFile对象表示一个用运行时的函数fopen打开的c运行时的流式文件.流式文件是被缓冲的, ...
- CStdioFile 写文件
前言: 介绍如何使用 CStdioFile 类去写文件. 完整工程代码,点我下载(请注意工程里面需要包含的 <locale.h>头文件 ) 示例: /// My Add // 获取当前路径 ...
- CFile、CStdioFile、FILE和其他文件操作(转+总结)
CFile.CStdioFile.FILE和其他文件操作(转+总结) 2010-04-10 20:36:33| 分类: VC++|举报|字号 订阅 下载LOFTER我的照片书 | ...
- 使用cstdiofile在vs2010中无法写入中文的问题
在VC2010环境下, 以下代码无法实现使用CStdioFile向文本文件中写入中文(用notepad.exe查看不到写入的中文) CStdioFile file; file.Open(…); fil ...
- MFC CStdioFile
读Text文件 void CNWiReworkDlg::ReadHexFile() { using namespace std; CStdioFile file; file.Open(hexFileP ...
- C++ writestring 为什么不能写进中文 CStdioFile向无法向文本中写入中文【二】
本地化设置需要具备三个条件:a. 语言代码 (Language Code)b. 国家代码 (Country Code) c. 编码(Encoding)本地名字可以用下面这些部分来构造:语言代码_国家代 ...
- CStdioFile的Writestring无法写入中文的问题
解决UNICODE字符集下CStdioFile的Writestring无法写入中文的问题 2009-12-01 23:11 以下代码文件以CStdioFile向无法向文本中写入中文(用notepad. ...
随机推荐
- Effective Objective-C 2.0之Note.02
1.多用类型常量,少用#define预处理指令 不要用预处理指令定义常量.这样定义出来的常量不含类型信息,编译器只是会在编译前据此执行查找与替换操作.即使有人重新定义了常量值,编译器也不会产生警告信息 ...
- 为什么学习Python
因为做iOS开发的,之前一直用OC,但是突然有一天苹果说出Swift,但是那时候的Swift真的是Bug多多,语法都不固定,所以只是大致看了看,而一年多之后,Swift已经发布2.0了,语言也相对稳定 ...
- C#泛型集合之Dictionary<k, v>使用技巧
1.要使用Dictionary集合,需要导入C#泛型命名空间 System.Collections.Generic(程序集:mscorlib) 2.描述 1).从一组键(Key)到一组值(Value) ...
- iOS9新系统下APP Store 应用上传新指南
一 iTunes Connect介绍 iTunes Connect是面向iOS应用开发人员的苹果门户网站,供开发人员管理其应用,跟踪下载情况.今年1月份闹得沸沸扬扬的iTunes Connect BU ...
- nodejs笔记一--模块,全局process对象;
一.os模块可提供操作系统的一些基本信息,它的一些常用方法如下: var os = require("os"); var result = os.platform(); //查看操 ...
- IT服务系统组成
软件+硬件+数据 + 运维人员 = IT服务系统 车 司机 乘客 修车 = 车模式 效率 系统 用户 业务 运维 = 信息化 效率 如果司机不会开车,没有人会修车就不会有车轮上的世界 同样没有人会运维 ...
- sql数据库的表连接方式图文详解
sql数据库表连接,主要分为:内连接.外连接(左连接.右连接 .全连接).交叉连接,今天统一整合一下,看看他们的区别. 首先建表填充值. 学生表:student(id,姓名,年龄,性别 ) 成绩表 ...
- Using sql azure for Elmah
The MSDN docs contain the list of T-SQL that is either partially supported or not supported. For ex ...
- HDU 1598 find the most comfortable road 并查集+贪心
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1598 find the most comfortable road Time Limit: 1000 ...
- PF_PACKET在内核的流程
PF_PACKET在内核的流程 套接字创建 packet_create() --> 赋值packet_ops 接收流程 packet_recvmsg() skb_recv_datagra ...