当前位置:网站首页>MFC CString to char*
MFC CString to char*
2022-07-02 14:56:00 【sam-zy】
/// <summary>
/// CString turn char*
/// </summary>
/// <param name="str"> Input CString type </param>
/// <returns> Converted char* type </returns>
char* CStringToCharArray(CString str)
{
int n;
n = WideCharToMultiByte(CP_OEMCP, 0, str, -1, NULL, 0, 0, FALSE); // Wide byte to multi byte
char* SendInt = new char[n];
memset(SendInt, 0, n * sizeof(char)); // initialization pSend
WideCharToMultiByte(CP_OEMCP, 0, str.GetBuffer(0), n, SendInt, n, 0, FALSE);
str.ReleaseBuffer(); // Release cache
return SendInt;
}
边栏推荐
猜你喜欢

【NOI模拟赛】伊莉斯elis(贪心,模拟)

Fabric.js 缩放画布

Yyds dry goods inventory software encryption lock function

taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface

Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022

Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting

Implement a server with multi process concurrency

STM32库函数进行GPIO初始化

【NOI模拟赛】刮痧(动态规划)

JMeter script parameterization
随机推荐
Fundamentals of software testing
Large top heap, small top heap and heap sequencing
微信小程序使用towxml显示公式
info [email protected] : The platform “win32“ is incompatible with this module.
Introduction to mathjax (web display of mathematical formulas, vector)
Yolov6 training: various problems encountered in training your dataset
Makefile separates file names and suffixes
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
String matching problem
C#延时、在线程中开启定时器、获取系统时间
C# richTextBox控制显示最大行数
buuctf-pwn write-ups (7)
Reuse and distribution
Actual combat sharing of shutter screen acquisition
LeetCode_字符串_简单_412.Fizz Buzz
【NOI模拟赛】伊莉斯elis(贪心,模拟)
Advanced C language (realize simple address book)
Tmall product details interface (APP, H5 end)
Factal: Unsafe repository is owned by someone else Solution
1、编辑利器vim