当前位置:网站首页>Fifth Bureau akali teaching Bureau data analysis
Fifth Bureau akali teaching Bureau data analysis
2022-07-21 20:33:00 【Cold hands a】
/*
Let's talk about pointers
Will be equivalent to a source file you create a shortcut , Right click shortcut --> Where to open the file ; Then you move the source file , You'll find that , No matter how your source files move , But you can find the location of the shortcut to open the file
This is equivalent to a pointer , Yours Wegame open lol In fact, it is also a pointer
*/
//#include<stdio.h>
//int main()
//{
// int number = 100;
// int* point = &number;//int*( Shaping the pointer ), Because the number is int type ; Right click the target of the attribute in the shortcut to store the address , therefore &number(number The address of );point It's a pointer variable
// printf("%p\n", &number);//%p It's a printed address
// printf("%d\n", *point);//*p Is dereference , You can understand it as double clicking the shortcut ( Open shortcut )
// *point = 200;
// printf("%d\n", *point);// It is equivalent to opening shortcut modification ( open word Document modification or something )
//
// // How much space does a pointer occupy ?
// 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*));
// // The pointer size is the same Pointers are used to store addresses How big is the address , How much space is the pointer ( The ID number on the ID card , That piece of land can be lost , I care about you fat, thin, tall, short )
//
// // I am 64 Bit , So the pointer size is 8 byte ;32 It's about 4
// return 0;
//}
/*
Tell me about just now printf("%p\n", &number); How did you get your address number
First of all, computers have 32(x86) Bit operating system and 64(x64) Bit operating system
With 32 Bit operating system, for example 32 Namely 32 Root address line , There are positive and negative charges after power on Electrical signals are converted into digital information 0 and 1
This is why computer language is a binary language
0 and 1 A total of 2^32 An orderly sequence of numbers ( Memory unit )
then 2^32 / 8 = ??? Divide bytes again 1024 Wait, you can calculate
If you take a bit as an address , One char To occupy 8 An address , Is this a little too wasteful
therefore C It is stipulated that a memory unit is a byte , Then assign an address
*/
/*-----------------------------------------
To describe a complex object , So there is a structure
You can't be used by others int,char Wait to describe , Is he a combination of good looks and intelligence , ha-ha
*/
#include<stdio.h>
struct people {
char name[20];
int EQ;
int IQ;
double height;
};
int main()
{
struct people one = { " Zhang San ", 85, 90, 165.51 };// The first person to create and information ( Structure appears and initializes )
printf("1.%s %d %d %lf\n", one.name, one.EQ, one.IQ, one.height);// The first person . Corresponding information ( Structure member variables )
struct people* point = &one;// Structure pointer
printf("2.%s %d %d %lf\n", (*point).name, (*point).EQ, (*point).IQ, (*point).height);
printf("3.%s %d %d %lf\n", point->name, point->EQ, point->IQ, point->height);//point( Shortcut )->name( Source program )
return 0;
}
边栏推荐
猜你喜欢
随机推荐
第10章 3D 点云特征描述提取
Deep analysis of string -- StrCmp & strncmp
boost::this_thread::sleep (boost::posix_time::microseconds (100000))报错“this_thread”:“::”左侧的符号必须是一种类型
C语言实现三子棋小游戏---格局打开版(
2020常州市程序设计小能手真题及题解
无法从“boost::shared_ptr<pcl::RangeImage>”转换为“const std::shared_ptr<const pcl::PointCloud<pcl::PointWit
1019 digital black hole
如何查看自己的Eigen版本
字符函数和字符串函数及其模拟实现(C语言)
如何使用正态分布变换进行配准
Those pits in distributed transactions
Stm32f407-ov7670 (no FIFO) -onenet- upload camera pictures to onenet (EDP protocol)
25.【判断是否是素数的方法】
C. Doremy‘s IQ
深度剖析 —— 数据
[C语言] 选择 循环还可以这样玩 代码表白光之国
1012数字分类
Pycharm Professional Edition creates flask project | downloads flask package | and some examples
如何通过IP共享文件
碎碎念 碎碎念 起稿