Thứ Hai, 11 tháng 7, 2011

Convert CString to int and vice versa in MFC

Today, i introduce you some ways to convert in MFC application. They will help you when you programme with MFC application.

 We will begin with CString and int formats.
 If you want to convert from int number to CString you can use syntax:

int  numberNeedConvert; 
CString numberConvert; 
...
// If you do not use unicode format for your progamme
numberConvert.Format("%d",numberNeedConvert);
// If you use unicode format for your programme
numberConvert.Format(L"%d",numberNeedConvert);


You will be able to convert CString to int if you use that syntax:


int number;
CString cstringNeedConvert;
char* temp;
...
// Convert CString to char* here
...
number = atoi(temp);

I hope it will help you. Please email to me if you need some help.
Thanks for visiting my blog!

Không có nhận xét nào:

Đăng nhận xét

Install Kubernetes using kubeadm with two nodes master & worker

Well come back for a long time my friends! Today I want to take a note about some basic knowledge about Kubernetes. I hope that it will...