如何将字符从Cstring变量移动到数组..? [英] How to move characters from Cstring variable to array ..?

查看:149
本文介绍了如何将字符从Cstring变量移动到数组..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想将Cstring变量中的字符逐个移动到数组中......有人知道吗?

解决方案

不确定为什么你要一个一个地做(一次多个),但 CString :: GetAt [ ^ ]方法允许您一次一个地获取角色。



CString :: GetBuffer [ ^ ]会允许你获取指向内部数组的指针,因此可以使用memcpy()或类似的东西快速复制任何数量的数据。记得以后通过调用 CString :: ReleaseBuffer [ ^ ]。


Google [< a href =https://www.google.co.uk/#q=CString+to+character+arraytarget =_ blanktitle =New Window> ^ ]知道。

Hi,

I want to move move a characters from Cstring variable to array one by one...Anybody know ?

解决方案

Not sure why you would want to do it one-by-one (versus multiple at a time), but the CString::GetAt[^] method allows you to get to the characters one at a time.

CString::GetBuffer[^] would allow you to get the pointer to the internal array and therefore be able to copy any amount of data off of it quickly using memcpy() or anything similar. Just remember to free up the buffer afterward by calling CString::ReleaseBuffer[^].


Google[^] knows.


这篇关于如何将字符从Cstring变量移动到数组..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆