zoukankan      html  css  js  c++  java
  • delphi inttohex 整型到十六进制

    inttohex

    from delphi help:

    Returns the hex representation of an integer.

    Unit

    SysUtils

    Category

    numeric formatting routines

    Delphi syntax:

    function IntToHex(Value: Integer; Digits: Integer): string; overload;
    function IntToHex(Value: Int64; Digits: Integer): string; overload;

    C++ syntax:

    extern PACKAGE AnsiString __fastcall IntToHex(int Value, int Digits);
    extern PACKAGE AnsiString __fastcall IntToHex(__int64 Value, int Digits);

    Description

    IntToHex converts a number into a string containing the number's hexadecimal (base 16) representation. Value is the number to convert. Digits indicates the minimum number of hexadecimal digits to return.

    功能说明:该函数用于将“十进制”转换成“十进制”。该函数有二个参数。第一个参数为要转换的十进制数据,第二个参数是指定使用多少位来显示十六进制数据。
      参考实例:
      Edit1.Text := IntToHex('100', 2);
      执行结果,Edit1.Text等于64。
      注意:Delphi没有提供专门的“十六进制”转换为“十进制”的函数。使用StrToInt函数可以实现这个功能。具体代码是:I := StrToInt('$' + '64'); 这时I等于100。加上一个'$'即可将“十六进制”转换为“十进制”。

       showmessage(IntTostr(StrToint( '$ '+edit1.text)));

  • 相关阅读:
    HNOI2018退役记
    codeforces 960G Bandit Blues
    codeforces 933D A Creative Cutout
    tyvj1953 Normal
    loj6119 「2017 山东二轮集训 Day7」国王
    codeforces 293E Close Vertices
    bzoj1808 [Ioi2007]training 训练路径
    bzoj2219 数论之神
    bzoj4361 isn
    loj2064[HAOI2016]找相同字符
  • 原文地址:https://www.cnblogs.com/jijm123/p/10849488.html
Copyright © 2011-2022 走看看