Day02?
目录
C语言从零学习笔记02
一、初识C语言
二、第一个C语言程序
三、代码上传Gitee
四.数据类型
这只是一篇新手个人学习笔记,其中不可避免出现理解不深不透,仅以督促自身及记录,如有错误,望批评指正!
一、初识C语言
C语言是一门通用计算机编程语言,广泛应用于底层开发。C语言的设计目标是提供一种能以简易 的方式编译、处理低级存储器、产 生少量的机器码以及不需要任何运行环境支持便能运行的编程语言。
二、第一个C语言程序
环境:win11
编辑器:VS2019

#include <stdio.h>
int main()
//C语言是从主函数第一行开始执行的,所以C语言代码需要有main函数-入口
//main函数是程序的入口
//int为整型的意思
{
printf("HelloWorld\\n");
printf("世界你好\\n");
return 0;
}
//一个工程中main函数有且仅有一个
三、代码上传Gitee
1.工具下载
Git:Git - Downloads (git-scm.com)
TortoiseGit:Download – TortoiseGit – Windows Shell Interface to Git
TortoiseGit中文包:https://download.tortoisegit.org/tgit/2.12.0.0/TortoiseGit-LanguagePack-2.12.0.0-64bit-zh_CN.msi
2.平台注册及工具安装
教程引申如下:gitee(码云)的注册和代码提交【手把手】_哔哩哔哩_bilibili
gitee(码云)的注册和代码提交【手把手】_哔哩哔哩_bilibili


四.数据类型
char //字符数据类型
short //短整型
int //整形
long //长整型
long long //更长的整形
float //单精度浮点数
double //双精度浮点数
#include <stdio.h>
int main()
{
printf("%d\\n", sizeof(char));
printf("%d\\n", sizeof(short));
printf("%d\\n", sizeof(int));
printf("%d\\n", sizeof(long));
printf("%d\\n", sizeof(long long));
printf("%d\\n", sizeof(float));
printf("%d\\n", sizeof(double));
printf("%d\\n", sizeof(long double));
return 0;
}

Sizeof()的单位是字节 byte
存在这么多的类型,是为了更加丰富的表达生活中的各种值。
接下来每一天都会持之以恒的学习 与君共勉!
|