关于C++ 到 DELPHI 的转换(40分)

G

gold8

Unregistered / Unconfirmed
GUEST, unregistred user!
一是类型变换:<br>&nbsp; &nbsp;C 中的int 对应的是integer 还是longint;<br>&nbsp; &nbsp;C 中的float 对应的是single 还是double;<br>&nbsp; &nbsp;有两种文献说法不一样。<br>二是关于指针与数组:<br>&nbsp; &nbsp;C 中有一结构<br>&nbsp; &nbsp;typedef struct tag_abc {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char name[14];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int &nbsp;min;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float tag;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} abc,*Pabc;<br><br>&nbsp; &nbsp;abc d;<br>&nbsp; &nbsp;Pabc pd;<br>要实现 &nbsp;memset(&amp;d,0,sizeof(d));<br>&nbsp; 用什么过程 , 如是 strmove 怎么用?<br><br>
 
在Delphi中integer和longint是一样的,都占32个字节,在某中意义上是相等的.<br>C中的float要对应Delphi中的Single,因为他们占的字节数是样的.<br>具体C中的memset函数和Delphi中的哪个函数对应我不知道,我我觉得可用TMemoryStream类<br>来实现这些.<br>
 
//memset==&gt;FillChar<br>//memset(&amp;d,0,sizeof(d));<br>FillChar(d, SizeOf(d), 0);<br><br>strmove是什么?![?]
 
to &nbsp;独帅 <br>uses SysUtils;<br>function StrMove(Dest: PChar; const Source: PChar; Count: Cardinal): PChar;<br>
 
多人接受答案了。
 
to gold8:<br>&nbsp; 我昨天看错了,我还以为您问的是C++中的“strmove”如何用?[:D]<br>我知道C++中没有这个函数,可没想到Delphi中有这个函数。<br>我一般用Move,不过strmove也是调用的Move。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部