写代码:
配置属性-链接器-系统-子系统-控制台
//int 是整型的意思
这种写法已过时:
// void main()
//包含一个叫stdio.h的文件
//std-标准 standard i-input o-outputs
//包含一个叫stdio.h的文件
//std-标准 standard i-input o-output
#include<stdio.h>
int main()//主函数-程序的入口-main函数有且仅有一个
{
//这里完成任务
//函数-print function - printf - 打印函数
//库函数-C语言本身提供的函数
//#include -
printf("hehe\n");
return 0;
}
数据类型:
char. //字符类型
short // 短整型
int // 整型
long //长整形
long long //更长的整型
float //单精度浮点数
double //双精度浮点数
%c //打印字符
%d //打印整型
%f //打印浮点型数字(小数)
%p //以地址的形式打印
%x //打印16进制数字
%o ......
为什么整型有四种?浮点数有两种?--数值范围不同,所占空间内存不同
int main()
{
//char ch = 'A';//内存
//printf(