zoukankan      html  css  js  c++  java
  • delphi数据类型及占用的字节数 C++ 对应数据类型

    delphi、C++、C# 数据类型对应

    byte:1个字节。

    int/Integer:

    long:

    long long:8字节,64位

    shortInt:2字节,16位

    LongInt:4字节,32位

     Int64:8字节,64位

    word:

    float:4字节

    double:8字节

    http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Delphi_to_C%2B%2B_types_mapping

    Delphi C++ C# 字节Byte 位数Bit  
    double double    8  32  
    single float    4  16  
     integer int    4  16  
     int64 long    8  32  
     short          
    word          
    Dword          
     ansichar char  char     -128-127
     byte  unsigned char        0~255

    PByte

    array[0..254] of  Byte;

    unsigned char*

    或者

    PBYTE

     ref byte       
    PByteArray
             

    TBytes;

     TArray<Byte>

     BYTE *

     函数参数

    ref byte

    byte[]

         

    LongInt

    DWORD

    unsigned long

    DWORD


    uint

           
       DWORD &

    ref uint

         
     var int int *

    ref int

         
    IntPtr HANDLE

    IntPtr

         
     array [0 .. $40] of AnsiChar;  

    StringBuilder

         
     SmallInt  short        
    PAnsiChar  char*        
     Word unsigned int        
      unsigned int*        
      LPVOID        
     Word unsigned short        0..65535
    Pointer VOID*          
     VARIANT

    VARIANT

    System::Variant

           
      VARIANT*  ref object            
    OleVariant System::OleVariant        
     WideString BSTR  string      
    TBytes   byte[]      

    TArray<Integer>

     s:array[1..5] of integer

    TIArr  = array of integer

      int[]      

    http://www.cnblogs.com/del/archive/2007/12/03/981563.html

    delphi与C#语法转换

    C#功能

       byte[] CopyToBig(byte[] bBig, byte[] bSmall)
            {
                List<byte> lTemp = new List<byte>();
                lTemp.AddRange(bBig);
                lTemp.AddRange(bSmall);
                bBig = new byte[lTemp.Count];
                lTemp.CopyTo(bBig);
                return bBig;
            }

    delphi实现

     var

    aint:integer;

    调用函数fun(int *);

    fun(&aint);

    var TagType:Word

      function fun1( x: Integer): Integer;

    function fun(var x: Integer): Integer;
    function fun2(const x: Integer): Integer;
  • 相关阅读:
    vue token使用 参考
    token 的作用与使用
    jq 绑定实时监听 input输入框
    认识java
    java基础语法
    java虚拟机笔记 运行时内存区域划分
    spring全家桶
    利用python脚本统计和删除redis key
    MySQL中count(字段) ,count(主键 id) ,count(1)和count(*)的区别
    编写shell脚本的一些规范
  • 原文地址:https://www.cnblogs.com/cb168/p/6108188.html
Copyright © 2011-2022 走看看