The c language implements a simple and easy language
- 2020-06-12 10:02:22
- OfStack
The familiar easy language base is the c language. The 32 key words of c plus 1 other common words are used to achieve simple Chinese substitution by using the macro definition #define
1. Now open VisualStudio and create a new.h file in the header file directory to start the macro definition to encapsulate our easy language
//auto Local variables (automatic storage)
#define automatic auto
//break Unconditionally exit the innermost loop of the program
#define interrupt break
//case switch Select an item in the statement
#define situation case
//char Single - byte integer data
#define character char
//const Defines an immutable constant value
#define constant const
//continue Break the loop and turn downward 1 loops
#define Continue to continue
//default switch The default selection in the statement
#define The default default
//do Used to form do.....while Looping statements
#define perform do
//double Defines double precision floating point data
#define double double
//else Constitute a if.....else Select program structure
#define Otherwise, else
//enum The enumeration
#define The enumeration enum
//extern Global variables are explained in other program modules
#define External variables extern
//float Defines single-precision floating point data
#define Single precision float
//for Constitute a for Looping statements
#define cycle for
//goto Constitute a goto Transfer structure
#define jump goto
//if Constitute a if....else Choose structure
#define if if
//int Basic integer data
#define The integer int
//long Long integer data
#define Long integer long
//registerCPU Internally stored variables
#define Register variables register
//return The return value used to return a function
#define return return
//short Short integer data
#define Short integer short
//signed A signed number
#define A signed signed
//sizoef Evaluates the number of bytes held by an expression or data type
#define For the size sizeof
//static Defining static variables
#define static static
//struct Define structure type data
#define The structure of the body struct
//switch Constitute a switch Choose structure
#define choose switch
//typedef Redefine the data type
#define To redefine the typedef
//union Federated type data
#define A consortium union
//unsigned Defines unsigned data
#define unsigned unsigned
//void Define untyped data
#define empty void
//volatile This variable can be implicitly changed during program execution
#define Hidden variables volatile
//while Used to form do...while or while Loop structure
#define when while
#define The main function main
#include<stdlib.h>
void notepad(){
system("notepad");
}
#define notepad notepad()
void calc(){
system("calc");
}
#define The calculator calc();
void tasklist(){
system("tasklist");
}
#define Process management tasklist();
#define Waiting for the getchar();
void ipconfig(){
system("ipconfig");
}
#define IP The viewer ipconfig();
#include<stdio.h>
void hello(){
printf("%s", "hello word");
}
#define Hello world hello();
2. Create a new.ES11en file under the source file directory, introduce our identifier file, and you can use our Chinese programming
Here "" and < > The difference is that one header file is introduced into the system and one is our own header file
#include"elanguage.h"
empty The main function (){
// The calculator
Process management
IP The viewer
Hello world
Waiting for the
}
Above is the relevant knowledge point content, thank you for the support of this site.