当前位置:网站首页>我的第二次博客——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;
}
边栏推荐
- 一家芯片公司倒在了B轮
- SaltStack进阶
- The difference between --save Dev and --save in NPM
- [physical application] Wake induced dynamic simulation of underwater floating wind turbine wind field with matlab code
- Application value of MES production management system to equipment
- 【物理应用】大气吸收损耗附matlab代码
- Qt: one signal binds multiple slots
- Sudo rosdep init error: cannot download default
- vim学习手册
- Swing事件处理的过程是怎样的?
猜你喜欢

JS modify table font and table border style

Validate hardware DDR design with Xilinx MIG

Understanding of PID

JS preventDefault() 键盘输入限制 onmousewheel stopPropagation停止事件传播

Qt: 一个SIGNAL绑定多个SLOT

C language (high-level) character function and string function + Exercise

SaltStack系统初始化

SaltStack进阶

Get to know nodejs for the first time (with cases)

VAE:变分自编码器的理解与实现
随机推荐
身份证号的奥秘
BM16 删除有序链表中重复的元素-II
关于白盒测试,这些技巧你得游刃有余~
6-20漏洞利用-proftpd测试
Learn from Li Mu, deep learning - linear regression and basic optimization function
Application of time series database in Hydropower Station
SQL audit tool self introduction owls
BM11 链表相加(二)
用LEX(FLEX)生成PL语言的词法分析器
Time waits for no man. The rise of TSDB is at the right time
Pytorch:交叉熵损失(CrossEntropyLoss)以及标签平滑(LabelSmoothing)的实现
An intern's journey to cnosdb
After several twists and turns, how long can the TSDB C-bit of influxdb last?
From Bayesian filter to Kalman filter (2)
2022年暑假ACM热身练习3(详细)
How to write a JMeter script common to the test team
IMU 加热
【雷达】基于核聚类实现雷达信号在线分选附matlab代码
Application of time series database in bridge monitoring field
OAI L3 and L2 interface analysis