字符串初始化

来源:互联网 发布:mac sierra是什么 编辑:程序博客网 时间:2024/06/06 02:20

#include<ntdef.h>

//定义字符串

UNICODE_STRING str = RTL_CONSTANT_STRING(L'my first string");

//随时初期化一个字符串

UNICODE_STRING str;

RtlInitUnicodeString(&str, L'my first string");


上面的做法不需要担心内存释放的问题,因为并没有分配任何内存。

0 0