Xx_Introduction

Point and Array germane.

Xx_Code

#include<stdio.h>
#define SIZE 4
int main(void)
{
short arra[SIZE];
short * a;
double arrb[SIZE];
int i;
double * b; a = arra;
b = arrb; for (i = 0; i < SIZE; i++)
printf("%d %p %p \n",i ,a + i,b + i);
return 0;
}

Ax_Address and Value

dates + 2 == &dates[2];    //true    address
*(dates + 2) == dates[2]; //true value
*dates + 2 = (*dates) + 2; // Beause '*' > '+'

<<<<<<<<<<"I am the dividing line ">>>>>>>>>>>>

Bx_Replace

x-a not use pointer

#include<stdio.h>
#define M 12 int main(void)
{
int days[M] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int i; for (i = 0; i < M; i++)
printf("Month %2d has %2d days.\n", i + 1, days[i]);
return 0;
}

x-b use pointer

#include<stdio.h>
#define M 12 int main(void)
{
int days[M] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int i; for (i = 0; i < M; i++)
printf("Month %2d has %2d days.\n", i + 1, *(days + i)); // equal to days[i]
return 0;
}

x-c Notice

V.V(vice versa)Use arrays to represent Pointers,but attention to

When an array is a function of an argument.

C lang:Pointer and Array的更多相关文章

  1. C lang:Pointer and multidimensional array

    Xx_Introduction Double indrection:Address of Address;Pointer of Pointer Ax_Code #include<stdio.h& ...

  2. Go: using a pointer to array

    下面的不是指针指向数组,而是指针指向Slice I'm having a little play with google's Go language, and I've run into someth ...

  3. c pointer and array

    Pointer:  A pointer is a variable that contains the address of a variable. if c is a char and p is a ...

  4. C lang:Pointer operation

    Xx_Pointer opteration Do not dereference initialized Pointers Ax_Code #include<stdio.h> int ma ...

  5. C lang: VLA(variable-length array)

    Xx_VLA Introduction VLA:variable-length array,not variable array size,but variable arary dimensional ...

  6. C lang: Pointer

    Ax_Terminology xa_pointer pointer is the address used to store the variable;A variable (or data obje ...

  7. The correct way to initialize a dynamic pointer to a multidimensional array

    From:https://stackoverflow.com/questions/18273370/the-correct-way-to-initialize-a-dynamic-pointer-to ...

  8. initial pointer [expert c]

    initial differece between pointer and array Both arrays and pointers can be initialized with a liter ...

  9. Reflection and array

    java.lang.Reflect.Array类提供了动态创建和访问数组元素的各种静态方法. package com.sunchao.reflection; import java.lang.refl ...

随机推荐

  1. [ch05-02] 用神经网络解决多变量线性回归问题

    系列博客,原文在笔者所维护的github上:https://aka.ms/beginnerAI, 点击star加星不要吝啬,星越多笔者越努力 5.2 神经网络解法 与单特征值的线性回归问题类似,多变量 ...

  2. git 使用详解(3)—— 最基本命令 + .gitignore 文件

    Git 基础 本章将介绍几个最基本的,也是最常用的 Git 命令,以后绝大多数时间里用到的也就是这几个命令.读完本章,你就能初始化一个新的代码仓库,做一些适当配置:开始或停止跟踪某些文件:暂存或提交某 ...

  3. BOM和DOM操作

    目录 BOM window对象 window子对象 location 弹出框 计时 history navigator DOM 查找节点 直接查找 间接查找 节点操作 创建节点 添加节点 删除节点 替 ...

  4. 【MobX】390- MobX 入门教程(上)

    点击上方"前端自习课"关注,学习起来~ 本文考虑到篇幅问题,将<MobX 入门教程>分成上.下两篇文章,方便阅读.分配安排: 一.MobX 介绍 首先看下官网介绍: ★ ...

  5. 【JS】324- JS中的内存管理(中高级前端必备)

    前言 像C语言这样的底层语言一般都有底层的内存管理接口,比如 malloc()和free()用于分配内存和释放内存.而对于JavaScript来说,会在创建变量(对象,字符串等)时分配内存,并且在不再 ...

  6. 【JS】304- KOA2框架原理解析和实现

    ); , () => {     ); 实现koa的第一步就是对以上的这个过程进行封装,为此我们需要创建application.js实现一个Application类的构造函数: ); , () ...

  7. Mysql数据库优化一:集群(读写分离)之主从服务器的安装与配置

    Mysql数据库的集群(读写分离),说白了就是将读操作和写操作分开在不同的服务器上实现,以达到提高效率的目的. 大致原理如下: 数据库中的所有操作都是有日志记录的(前提是要打开这个日志记录功能) 1. ...

  8. RocketMQ 整合 DLedger(多副本)即主从切换实现平滑升级的设计技巧

    目录 1.阅读源码之前的思考 2.从 Broker 启动流程看 DLedger 2.1 构建 DefaultMessageStore 2.2 增加节点状态变更事件监听器 2.3 调用 DefaultM ...

  9. PDF提取表格的网页工具——Excalibur

      在之前的文章另类爬虫:从PDF文件中爬取表格数据中,我们知道如何利用Python的camelot模块,通过写Python程序来提取PDF中的表格数据.本文我们将学习如何用更便捷的工具从PDF中提取 ...

  10. Linux服务器部署.Net Core笔记:四、安装Supervisor进程守护

    Supervisor 是用 Python 开发的 Linux/Unix 系统下的一个进程管理工具.它可以使进程脱离终端,变为后台守护进程(daemon).实时监控进程状态,异常退出时能自动重启. Su ...