当前位置:网站首页>我的第二次博客——C语言
我的第二次博客——C语言
2022-07-28 17:29:00 【披星戴月的贾维斯】
很高兴在今天,也就是10月22日写下我的博客——关于C语言学
我的编程目标,能够最快在大一上期到下期的寒假把C语言基础打牢靠,基本学完,基础不牢,地动山摇;学习编程,我觉得还是要多靠自己去亲手打,还要多在b站看网课,主要靠自学编程和学校上的专业课为主;希望经过大学四年的学习,进入如腾讯,或者字节等等那些大型IT公司
//C语言中的hex表示十六进制,oct表示八进制,dec表示十进制,bin表示二进制
//计算常见几种类型的字节长度
int main()
{
int a, b, c, d;
a = sizeof(short);
b = sizeof(int);
c = sizeof(long);
d = sizeof(long long);
printf("%hd\n", a);
printf("%d\n", b);
printf("%d\n", c);
printf("%d\n", d);
return 0;
}
常见关键字归类
aunt break case char const continue default do double else enum
extern float for goto if int long register return short signed
sizeof static struct switch typedef union unsigned void volatile while
#include<stdio.h>//头文件
int main()
{ int a = 0, b = 0;//变量初始化
printf(")
return 0;
}
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//int main()
//{
// printf("%d\n", printf("Hello world!\n") - 1);
//
// return 0;
//}
//static
//void test()
//{
// static int a = 1;
// a++;
// printf("%d ", a);
//}
//int main()
//{
// int i = 0;
//
// while (i < 10)
// {
// test();
// i++;
// }
//
// return 0;
//}
//extern是一个关键字,是用来声名外部符号
// extern int g_val = 2021;
//int main()
//{
// printf("%d", g_val);
//
// return 0;
//}
//如果不加 extern去声名你所定义的外部符号
//则main 函数调用不了此外部符号
//一个全局变量在整个工程的其他文件内部能被使用,是因为全局变量具有外部连接属性
//当一个全局变量被static修饰的时候,这个变量的外部链接属性就变成了内部链接属性
//使得这个全局变量只能在自己所在的源文件内部使用,其他文件不能再使用
int Add(int x, int y)
{
return x + y;
}
int main()
{
int a, b;
scanf("%d%d", &a, &b);
int ret = Add(a, b);
printf("%d", ret);
return 0;
}
边栏推荐
- 三类6种地图可视化软件测评,最好用的工具居然是它
- IMU heating
- Tikz draw Gantt chart in FJSP -trans necessary
- Pointer learning of C language -- the consolidation of pointer knowledge and the relationship with functions, arrays and structures
- 关于ASM冗余问题
- Fantasy 5 (ue5) game engine complete course 2022
- SaltStack之数据系统
- [solved] ac86u ml revision firmware virtual memory creation failed, prompting that the USB disk reading and writing speed does not meet the requirements
- How to use Qianqian listening sound effect plug-in (fierce Classic)
- Pyg builds heterogeneous graph attention network han to realize DBLP node prediction
猜你喜欢

Qt: one signal binds multiple slots

Method of win7 system anti ARP attack

Application of TSDB in civil aircraft industry

SQL审核工具自荐Owls

Adobe XD web design tutorial

一家芯片公司倒在了B轮

Efficiency comparison of JS array splicing push() concat() methods

Srs4.0 installation steps

Bm11 list addition (II)

Application of time series database in museum environment detection
随机推荐
【图像隐藏】基于DCT、DWT、LHA、LSB的数字图像信息隐藏系统含各类攻击和性能参数附matlab代码
CVPR21-无监督异常检测《CutPaste:Self-Supervised Learning for Anomaly Detection and Localization》
Jestson nano Object detection
【滤波跟踪】基于EKF、时差和频差定位实现目标跟踪附matlab代码
Lookup - lookup of sequential table and ordered table
Cv5200 wireless WiFi communication module, wireless video image transmission, real-time wireless communication technology
【物理应用】大气吸收损耗附matlab代码
Leetcode skimming - super power 372 medium
【雷达】基于核聚类实现雷达信号在线分选附matlab代码
[image segmentation] vein segmentation based on directional valley detection with matlab code
Doxygen document generation tool
MES生产管理系统对设备的应用价值
[physical application] atmospheric absorption loss with matlab code
Image processing web application development tutorial
SaltStack进阶
Application of time series database in cigarette factory
About ASM redundancy
[filter tracking] target tracking based on EKF, TDOA and frequency difference positioning with matlab code
Srs4.0 installation steps
Efficiency comparison of JS array splicing push() concat() methods