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. shell ssh 远程机器 追加文件内容

    在host1上,把下面的两行内容通过ssh追加到host2上的/etc/ca-certificates.conf文件中 I am a student Are you ok ssh host2 &quo ...

  2. postman tests常用方法

    postman常用方法集合: 1.设置环境变量 postman.setEnvironmentVariable("key", "value"); pm.envir ...

  3. Reachability的使用

    刚到一家新公司 做新项目 关于网络状态的监听和同事产生了不一样的看法 原来我的网络监听都是自己写的 后来发现自己不是一般的傻 有一个叫做Reachability的东西 很简单 很实用 很暴力 下面就是 ...

  4. flex布局的兼容问题

    一.W3C各个版本的flex 2009 version 标志:display: box; or a property that is box-{*} (eg. box-pack) 2011 versi ...

  5. Java修炼——Set的子接口Vector的方法使用

    Vector的方法和ArrayList相似 package com.bjsxt.Array; import java.util.Iterator; import java.util.List; imp ...

  6. UVA-11107 Life Forms(求出现K次的子串,后缀数组+二分答案)

    题解: 题意: 输入n个DNA序列,你的任务是求出一个长度最大的字符串,使得它在超过一半的DNA序列中出现.如果有多解,按照字典序从小到大输入所有解. 把n个DNA序列拼在一起,中间用没有出现过的字符 ...

  7. FPGA+VGA+OV7725 视频图像FPGA开发板 图像采集板CP511A使用

     

  8. Hybrid App 应用开发中 9 个必备知识点复习(WebView / 调试 等)

    前言 我们大前端团队内部 ?每周一练 的知识复习计划继续加油,本篇文章是 <Hybrid APP 混合应用专题> 主题的第二期和第三期的合集. 这一期共整理了 10 个问题,和相应的参考答 ...

  9. Vue底层实现原理总结

    要实现MVVM 响应式原理,要实现如下几点 1.实现一个数据监听器Observer,能够对数据对象的所有属性进行监听,如有变动可拿到最新值并通知订阅者 2.实现一个指令解析器Compile,对每个元素 ...

  10. 大数据学习笔记——Java篇之集合框架(ArrayList)

    Java集合框架学习笔记 1. Java集合框架中各接口或子类的继承以及实现关系图: 2. 数组和集合类的区别整理: 数组: 1. 长度是固定的 2. 既可以存放基本数据类型又可以存放引用数据类型 3 ...