The format for defining variables in C language is very simple, as follows:
数据类型 变量名;
Note: Do not lose the final semicolon. The definition of a variable is a statement, and statements end with a semicolon.
"Data type" indicates what type of variable you want to store. If you want to store integers, define it as int type; if you want to store decimals, define it as float or double type.
"Variable name" is what name you want to give this variable, usually using letters. For example:
int i;
The above statement indicates that an integer variable i is defined.
Recommended tutorial: c language tutorial
The above is the detailed content of How to define variables in C language. For more information, please follow other related articles on the PHP Chinese website!