16,472
社区成员
发帖
与我相关
我的任务
分享
strPath = CGlobal::m_BackupAddress;
strPath += strTime;
strPath = "C:\\Backup\\";
strPath += strTime;
GetPrivateProfileString("Student","Name","DefaultName",SName.GetBuffer(MAX_LENGTH),MAX_LENGTH,"c:\\setting.ini");
结果:SName = "jacky";这里需要注意点就是用完GetBuffer函数后一定要释放(用SName.ReleaseBuffer()函数),不然后面再用到SName的其他子函数就会失灵。
::GetPrivateProfileString("Backup","time","",strTemp.GetBuffer(50),50,".//test.ini");
CString s1,s2;
s1 = "111";
s2 =strTemp+s1;
class CTest
{
public:
static int a;
};
int CTest::a = 1;
void main()
{
int b(0),c(1);
b = CTest::a;
b += c;
cout<<b<<endl;
}
CGloabl
{
public:
static CString m_BackupAddress;
}