简体   繁体   English

C ++到vb.net TCHAR数组使用转换

[英]C++ to vb.net TCHAR array use conversion

I'm not a c++ programmer, I need to convert this c++ code to vb.net: 我不是c ++程序员,我需要将这个c ++代码转换为vb.net:

int iRC = 0;            
TCHAR ptcTemp[20];
_itot_s(iRC, ptcTemp, sizeof(ptcTemp), 10);

I don't really understand, all I know is that this is a conversion of an Int to a TCHAR array. 我真的不明白,我所知道的是这是一个Int转换为TCHAR数组。

I was wondering if 我想知道是否

Dim ptcTemp As String = iRC.ToString()

Would work or maybe I'll miss something? 会工作还是我会错过什么?

Any help is apreciated! 任何帮助都是折旧的! Thanks :) 谢谢 :)

_itot_s = integer to t with security _itot_s =具有安全性的整数到t

  • i integer 我是整数
  • to
  • t, type t, this is because C++ can have ASCII or UNICODE, this source code can be compiled as either. t,输入t,这是因为C ++可以有ASCII或UNICODE,这个源代码可以编译为。
  • s security/safe version, the function has 2 parameters for the buffer, the buffer and its length, so the function can prevent a buffer overload. s安全/安全版本,该函数有2个参数用于缓冲区,缓冲区及其长度,因此该函数可以防止缓冲区过载。

The 10 is so the string is a decimal, other popular options are 2 binary, 8 octal, 16 hex. 10是字符串是十进制,其他流行的选项是2二进制,8八进制,16十六进制。

What you are doing will work OK. 你正在做的事情会好起来的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM