大家熟知的易語言底層其實就是c語言來實現(xiàn)的,c語言的32個關(guān)鍵字加上一些常用的其他,使用#define這種宏定義來實現(xiàn)簡單的漢語替換

專業(yè)領(lǐng)域包括成都網(wǎng)站建設(shè)、成都網(wǎng)站制作、商城建設(shè)、微信營銷、系統(tǒng)平臺開發(fā), 與其他網(wǎng)站設(shè)計及系統(tǒng)開發(fā)公司不同,創(chuàng)新互聯(lián)的整合解決方案結(jié)合了幫做網(wǎng)絡(luò)品牌建設(shè)經(jīng)驗和互聯(lián)網(wǎng)整合營銷的理念,并將策略和執(zhí)行緊密結(jié)合,為客戶提供全網(wǎng)互聯(lián)網(wǎng)整合方案。
1.下面就先打開VisualStudio,在頭文件目錄下新建一個 標識符.h 的文件,開始宏定義封裝我們的易語言
//auto 局部變量(自動儲存)
#define 自動 auto
//break無條件退出程序最內(nèi)層循環(huán)
#define 中斷 break
//case switch語句中選擇項
#define 情況 case
//char單字節(jié)整型數(shù)據(jù)
#define 字符 char
//const定義不可更改的常量值
#define 常量 const
//continue中斷本次循環(huán),并轉(zhuǎn)向下一次循環(huán)
#define 繼續(xù) continue
//default switch語句中的默認選擇項
#define 默認 default
//do 用于構(gòu)成do.....while循環(huán)語句
#define 執(zhí)行 do
//double定義雙精度浮點型數(shù)據(jù)
#define 雙精度 double
//else構(gòu)成if.....else選擇程序結(jié)構(gòu)
#define 否則 else
//enum枚舉
#define 枚舉 enum
//extern在其它程序模塊中說明了全局變量
#define 外部變量 extern
//float定義單精度浮點型數(shù)據(jù)
#define 單精度 float
//for構(gòu)成for循環(huán)語句
#define 循環(huán) for
//goto構(gòu)成goto轉(zhuǎn)移結(jié)構(gòu)
#define 跳轉(zhuǎn) goto
//if構(gòu)成if....else選擇結(jié)構(gòu)
#define 如果 if
//int基本整型數(shù)據(jù)
#define 整數(shù) int
//long長整型數(shù)據(jù)
#define 長整型 long
//registerCPU內(nèi)部寄存的變量
#define 寄存變量 register
//return用于返回函數(shù)的返回值
#define 返回 return
//short短整型數(shù)據(jù)
#define 短整型 short
//signed有符號數(shù)
#define 有符號 signed
//sizoef計算表達式或數(shù)據(jù)類型的占用字節(jié)數(shù)
#define 求大小 sizeof
//static定義靜態(tài)變量
#define 靜態(tài) static
//struct定義結(jié)構(gòu)類型數(shù)據(jù)
#define 結(jié)構(gòu)體 struct
//switch構(gòu)成switch選擇結(jié)構(gòu)
#define 選擇 switch
//typedef重新定義數(shù)據(jù)類型
#define 重新定義 typedef
//union聯(lián)合類型數(shù)據(jù)
#define 聯(lián)合體 union
//unsigned定義無符號數(shù)據(jù)
#define 無符號 unsigned
//void定義無類型數(shù)據(jù)
#define 空 void
//volatile該變量在程序中執(zhí)行中可被隱含地改變
#define 隱藏變量 volatile
//while用于構(gòu)成do...while或while循環(huán)結(jié)構(gòu)
#define 當 while
#define 主函數(shù) main
#include<stdlib.h>
void notepad(){
system("notepad");
}
#define 記事本 notepad()
void calc(){
system("calc");
}
#define 計算器 calc();
void tasklist(){
system("tasklist");
}
#define 進程管理 tasklist();
#define 等待 getchar();
void ipconfig(){
system("ipconfig");
}
#define IP查看器 ipconfig();
#include<stdio.h>
void hello(){
printf("%s", "hello word");
}
#define 你好世界 hello();
2.在源文件目錄下面新建一個.c文件,引入我們的標識符文件,就可以使用我們的漢語編程了
這里" "和<>的區(qū)別就是一個引入系統(tǒng)的頭文件,一個是我們自己的頭文件
#include"elanguage.h"
空 主函數(shù)(){
//計算器
進程管理
IP查看器
你好世界
等待
}
以上就是相關(guān)的知識點內(nèi)容,感謝大家對創(chuàng)新互聯(lián)的支持。
網(wǎng)站名稱:c語言實現(xiàn)簡單的易語言
網(wǎng)頁URL:http://www.chinadenli.net/article46/gidhhg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機網(wǎng)站建設(shè)、品牌網(wǎng)站設(shè)計、標簽優(yōu)化、ChatGPT、網(wǎng)站排名、網(wǎng)站設(shè)計公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)