当前位置:网站首页>我的第二次博客——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;
}
边栏推荐
- Qt: 一个SIGNAL绑定多个SLOT
- 顺序线性表——课上练
- Gmoea code operation 2 -- establishment and operation of operation environment
- RTC clock: a calendar
- Nips18(AD) - 利用几何增广的无监督异常检测《Deep Anomaly Detection Using Geometric Transformations》
- How to use Qianqian listening sound effect plug-in (fierce Classic)
- 图书管理数据库系统设计
- Libgdx learning road 02: draw game map with tiled
- Pytorch:交叉熵损失(CrossEntropyLoss)以及标签平滑(LabelSmoothing)的实现
- SaltStack系统初始化
猜你喜欢

OAI L3 and L2 interface analysis

使用Xilinx MIG验证硬件DDR设计

Bm11 list addition (II)

Libgdx learning road 02: draw game map with tiled

Fundamentals of software testing and development | practical development of several tools in testing and development

Adobe Flash player 34.0.0.92 and available version modification methods (2021-01-23

From Bayesian filter to Kalman filter (zero)
![[image segmentation] vein segmentation based on directional valley detection with matlab code](/img/82/7b7b761c975cd5c2f5b8f3e43592d2.png)
[image segmentation] vein segmentation based on directional valley detection with matlab code

Self-adaptive multi-objective evolutionary algorithm for flexible job shop scheduling with fuzzy pro

Validate hardware DDR design with Xilinx MIG
随机推荐
TSDB and blockchain
Validate hardware DDR design with Xilinx MIG
CVPR21-无监督异常检测《CutPaste:Self-Supervised Learning for Anomaly Detection and Localization》
[image segmentation] vein segmentation based on directional valley detection with matlab code
软件测试开发基础|测开中的几个工具开发实战
Jestson nano Object detection
6-20漏洞利用-proftpd测试
6-20 vulnerability exploitation proftpd test
Jestson nano Object detection
Self-adaptive multi-objective evolutionary algorithm for flexible job shop scheduling with fuzzy pro
FTM module of K60: configure motor, encoder and steering gear
Libgdx learning road 02: draw game map with tiled
[filter tracking] target tracking based on EKF, TDOA and frequency difference positioning with matlab code
CVPR19 - 调参干货《Bag of Tricks for Image Classification with Convolutional Neural Network》
Pointer learning of C language -- the consolidation of pointer knowledge and the relationship with functions, arrays and structures
SaltStack之return与job管理
机器学习 --- 模型评估、选择与验证
[image hiding] digital image information hiding system based on DCT, DWT, LHA, LSB, including various attacks and performance parameters, with matlab code
身份证号的奥秘
【物理应用】水下浮动风力涡轮机的尾流诱导动态模拟风场附matlab代码