摘要: 1.C++很简单的一种办法:#include <iostream>#include <fstream>using namespace std;#define FILENAME "stat.dat"int main(){ fstream _file; _file.open(FILENAME,ios::in); if(!_file) { cout<<FILENAME<<"没有被创建"; } else { cout<<FILENAME<<"已经存在"; } return 0;}2.利用 c 语言的库的办法: 函数名: acces 阅读全文
posted @ 2011-02-17 11:49 oayx 阅读(8981) 评论(0) 推荐(0) 编辑
摘要: Visual Studio 2005 Other Versions Visual Studio 2010 Visual Studio 2008 Write formatted data to a string. These are versions of sprintf, _sprintf_l, swprintf, _swprintf_l, __swprintf_l with security enhancements as described in Security Enhancements in the CRT.CopyParametersbuffer Storage location 阅读全文
posted @ 2011-02-17 11:16 oayx 阅读(2589) 评论(0) 推荐(0) 编辑
摘要: 在VC2005的CRT中,增加了一些具有更强安全性的CRT函数,例如strcpy_s, strncat_s等。(MSDN: <Security Enhancements in the CRT > Significant enhancements have been made to make the CRT more secure. Many CRT functions now have more secure versions. If a new secure function exists, the older, less secure version is marked as 阅读全文
posted @ 2011-02-17 10:08 oayx 阅读(8708) 评论(0) 推荐(0) 编辑
摘要: 看名字明白,它和strcpy()函数的功能应该一样的。strcpy函数,就象gets函数一样,它没有方法来保证有效的缓冲区尺寸,所以它只能假定缓冲足够大来容纳要拷贝的字符串。在程序运行时,这将导致不可预料的行为。用strcpy_s就可以避免这些不可预料的行为。这个函数用两个参数、三个参数都可以,只要可以保证缓冲区大小。三个参数时:errno_t strcpy_s( char *strDestination, size_t numberOfElements, const char *strSource );两个参数时:errno_t strcpy_s( char (&strDestina 阅读全文
posted @ 2011-02-17 10:03 oayx 阅读(21566) 评论(0) 推荐(0) 编辑