国产探花免费观看_亚洲丰满少妇自慰呻吟_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(三)

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

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 通许县| 云霄县| 汝南县| 邮箱| 和林格尔县| 正宁县| 江都市| 茶陵县| 巴彦淖尔市| 平谷区| 仲巴县| 沙湾县| 连山| 海原县| 施秉县| 邵东县| 玉山县| 和静县| 阿拉善盟| 扎鲁特旗| 青神县| 海淀区| 确山县| 定西市| 敦煌市| 永和县| 上虞市| 正阳县| 克什克腾旗| 岳西县| 惠水县| 会宁县| 多伦县| 汶川县| 香港| 特克斯县| 十堰市| 公主岭市| 广饶县| 溧水县| 泰和县|