065.Pointer 什么是指针
来源:互联网 发布:淘宝实名认证人脸识别 编辑:程序博客网 时间:2024/06/01 12:12
--------------- main.m ---------------
#import<Foundation/Foundation.h>
intmain()
{
int a = 200;
int* p;
p = &a;
NSLog(@"%d", *p);
NSLog(@"%d", a == (*(&a)));
}
一、编写本节代码的具体步骤:
1.参照003节的代码编写步骤。
二、本节代码涉及到的知识点:
1. & 是 取地址运算符。后面通常紧跟一个变量,该运算符的作用就是读取后面这个变量的内存地址。
2. * 是 取变量运算符。后面通常紧跟一个指针,该运算符的作用就是读取后面这个指针所指的变量。
3. int* 这里的*不是运算符,这里的*与int 可以看做是一个整体,代表变量的类型是“整型指针”。
4. 记住,指针只能保存一个变量的地址,不能保存任何类型的数值。
0 0
- 065.Pointer 什么是指针
- 065.Pointer 什么是指针
- 什么是智能指针 what is smart pointer
- 什么是this指针 What is this pointer
- 指针(Pointer)
- 什么是d-pointer
- 084.Pointer Pointer 指向指针的指针
- 084.Pointer Pointer 指向指针的指针
- Smart Pointer--智能指针
- 智能指针(smart pointer)
- Wild Pointer 野指针
- 函数指针Function Pointer
- dangling pointer 悬垂指针
- 函数指针 Function Pointer
- 智能指针(smart pointer)
- 智能指针(Smart Pointer)
- 模拟指针(simulated pointer)
- C++ Pointer(指针)
- mac命令行安装homebrew
- 062.#IfDef 使用宏来进行条件编译
- 063.#IfDef 使用宏来控制调试信息
- 064.#If #else 与if else的区别
- Git学习
- 065.Pointer 什么是指针
- UVA490注意字符串后面内容,不要想当然
- AndroidStudio快捷键汇总
- 本人博客已迁移
- 066.Pointer 使用指针替换一个变量的值
- 067.Pointer 使用指针交换两个变量的值
- wyh2000 and a string problem(bc题)
- (Windows Maven项目)Redis数据库的安装和操作实现
- 068.Pointer 指针为什么分类型