国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C++ > 正文

如何將C/C++程序轉譯成Delphi(四)

2019-11-18 18:50:25
字體:
來源:轉載
供稿:網友

2.3. #defines as constants

C and C++ use #defines in several ways. In a C header file #define can be used

  • for declaring a constant
  • for declaring a symbol for conditional compilation
  • for macros

This chapter describes the translation of #define into Delphi constants.

The format for declaring constants in C is:

#define NameOfConstant Value 

For example:

#define TIME_ZONE_ID_UNKNOWN 0 #define TIME_ZONE_ID_STANDARD 1#define TIME_ZONE_ID_DAYLIGHT 2

The translation in Delphi is:

CONST  TIME_ZONE_ID_UNKNOWN = 0;  TIME_ZONE_ID_STANDARD = 1;  TIME_ZONE_ID_DAYLIGHT = 2;


Back to contents

2.3.1. Hexadecimal values

C uses the PRefix 0x to specify a hexadecimal value. For example, the C declaration

#define MY_CONSTANT 0xFF 

translates to Delphi as

CONST  MY_CONSTANT = $FF;


Back to contents


上一篇:如何將C/C++程序轉譯成Delphi(五)

下一篇:如何將C/C++程序轉譯成Delphi(三)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 微山县| 大同县| 常宁市| 金秀| 玉溪市| 循化| 芦山县| 昆明市| 昌平区| 株洲县| 余姚市| 神池县| 利辛县| 石景山区| 湘阴县| 贵定县| 陆良县| 汉寿县| 辉南县| 昆山市| 尼勒克县| 浮山县| 伊吾县| 左云县| 磐安县| 南城县| 辛集市| 望城县| 茌平县| 乌鲁木齐市| 淳安县| 仲巴县| 伽师县| 广宁县| 府谷县| 织金县| 长岛县| 日土县| 互助| 尼勒克县| 临邑县|