当前位置:网站首页>Read the manuscript in pieces
Read the manuscript in pieces
2022-07-21 20:33:00 【Cold hands a】
/*
The last battle
Finish this game , basic C A general review
keyword ( Also called reserved words , See P It's the parking lot , See keywords , It is a symbol with a mark in )
Keywords cannot be created by themselves C Provided You can't do variable names
*/
//auto Declare automatic variables
//#include<stdio.h>
//int main()
//{
// {
// auto int number = 100;// local variable
// //auto Declare automatic variables ( Every local variable is auto Embellished , Automatic creation and automatic destruction are automatic variables ,auto Omit not to write )
// int number2 = 120;
// //auto Omit
// }
// return 0;
//}
//continue End the current cycle , Start next cycle
//#include<stdio.h>
//int main()
//{
// int frequency = 1;
// for (frequency = 1; frequency <= 50; frequency++) {
// if (frequency == 25) {
// continue;// When the conditions are met (25), End the current cycle , Start next cycle , So I can't print 25
// }
// printf(" Number of prints :%d\n", frequency);
// }
// return 0;
//}
//extern Declare that variables or functions are defined in other files or other locations in this file
//#include<stdio.h>
//extern number_one;
//int main()
//{
// printf("%d\n", number_one);
// return 0;
//}
//extern( Declaring external symbols ) You also understand it as using strlen function , Understand it like calling header file
//go to sentence Jump statements without conditions The example I give is not very good , Code loop , Focus on understanding
//#include<stdio.h>
//int main()
//{
// printf("1 Don't go to Myanmar \n");
// GG:// Transfer location , Be sure to add. :( The colon )
// printf("2 Don't go to Myanmar \n");
// printf("3 Don't go to Myanmar \n");
// goto GG;// goto It's the portal To where ? Transferred to the GG The place of
// printf("1 Don't go to Myanmar \n");// Never execute
// return 0;
//}
//register Declare register variables
//#include<stdio.h>
//int main()
//{
// register int number = 100;// It is recommended to put this value in the register ( Whether to put it or not depends on the compiler , Just suggest )
// return 0;
//}
/*
register ???
Let's start with a question , Where can the data be stored ? Network disk ( Baidu network disk ah what ) Hard disk (C disc ,D Plate, etc. ) Memory Advanced caching register Do you find that the faster the speed from left to right , The smaller the space
In order to improve the computer speed , The computer will put a lot of frequently used data in registers When you can't find it in the register Find advanced cache Layers down In this way, the speed increases a lot
*/
//static Declare static variables 3 A role ; 1. Modify local variables 2. Modify global variable 3. Modify function
//#include<stdio.h>
//void Test() {
// static int number = 0;//static After modification , Local variables do not die , It extends the life cycle Keep the last number++ The results of the implementation of
// number++;
// printf("%d\n", number);
//
//}
//int main()
//{
// int frequency = 0;
//
// while (frequency < 10) {
// Test();
// frequency++;
// }
//
// return 0;
//}
//static Changing the life cycle of local variables , Essentially, it changes the storage type of data
// The storage types of data are The stack area ( Store local variables and function parameters , You can understand it as storing temporary ) Heap area ( Dynamic memory allocation , You can understand that there are always changes ) Static zone ( Deposit static Decorated things and static variables , You can understand it as stored for a long time )
//static Modify global variable And functions , It can only be used in this document static Something to decorate ,extern You can't even come
//define Used to alias data types
//#include<stdio.h>
//#define MAX 10000 // Definition MAX The value is 1000( Defining symbols )
//#define ADD(X, Y) X+Y//define Defining macro
//int main()
//{
// printf("%d\n", ADD(5, 6));// The result is 11
// printf("%d\n", 5 * ADD(5, 6)); // amount to 5*5+6=31
// return 0;
//}
//typedef Used to alias data types ( Is to change the name )
#include<stdio.h>
typedef double decimal;// use decimal To express double type
int main()
{
double number = 3.14;
decimal number2 = 3.1415;
printf("%lf\n", number2);
return 0;
}
//union Type of community ; volatile Explain that variables can be implicitly changed during program execution Let's not talk about these two first
// Thank you for your company all the way , A general summary C
边栏推荐
猜你喜欢
随机推荐
让代码解决《线性代数》系列 - 求多项式的最大公因式
In depth analysis of string -- strcpy & strncpy
D. Insert a progression (Mathematics)
原型、原型链、构造函数、实例的关系
Acwing 175 circuit maintenance
深度剖析数据在内存中的存储
矩阵求导常用公式(避坑)+矩阵的模和矩阵的绝对值的求导
namespace 命名空间
Deep analysis of string -- strchr & strstr
Hetai ht32 -- taojingchi tjc--t0 serial port screen learning notes (II)
无人机的微分平坦性详细推导
[C语言]一百个奥特曼大战一百个怪兽 源代码
理解JS的三座大山
第10章 3D 点云特征描述提取
Luogu p1119 post disaster reconstruction (Floyd)
1027 print hourglass
[C语言] 选择和循环来诠释浪漫 源代码
C. Binary String(求前缀和)
learning opencv3_2-11_写入AVI文件
1014 Sherlock Holmes date