C lang:Pointer and Array
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的更多相关文章
- C lang:Pointer and multidimensional array
Xx_Introduction Double indrection:Address of Address;Pointer of Pointer Ax_Code #include<stdio.h& ...
- Go: using a pointer to array
下面的不是指针指向数组,而是指针指向Slice I'm having a little play with google's Go language, and I've run into someth ...
- 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 ...
- C lang:Pointer operation
Xx_Pointer opteration Do not dereference initialized Pointers Ax_Code #include<stdio.h> int ma ...
- C lang: VLA(variable-length array)
Xx_VLA Introduction VLA:variable-length array,not variable array size,but variable arary dimensional ...
- C lang: Pointer
Ax_Terminology xa_pointer pointer is the address used to store the variable;A variable (or data obje ...
- 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 ...
- initial pointer [expert c]
initial differece between pointer and array Both arrays and pointers can be initialized with a liter ...
- Reflection and array
java.lang.Reflect.Array类提供了动态创建和访问数组元素的各种静态方法. package com.sunchao.reflection; import java.lang.refl ...
随机推荐
- python 协程与go协程的区别
进程.线程和协程 进程的定义: 进程,是计算机中已运行程序的实体.程序本身只是指令.数据及其组织形式的描述,进程才是程序的真正运行实例. 线程的定义: 操作系统能够进行运算调度的最小单位.它被包含在进 ...
- 洛谷 题解 P5534 【【XR-3】等差数列】
我又双叒叕被包菜辣! 题目 这道题是不久前的考试题,现在来水一篇题解 扯回正题 题目很明显的告诉你了,这是一个等差数列, 然后,还告诉你了首项, 第二项, 项数. 你还想咋滴 告诉了你首项和第二项,相 ...
- mac eclipse Android开发环境搭建
http://www.cnblogs.com/macro-cheng/archive/2011/09/30/android-001.html
- 移动开发在路上-- IOS移动开发系列 网络交互四(1)
最近一段时间上班忙的没日没夜的,不是披星戴月,就是头天早上出门,第二天早上回家...一直没出处时间来更新博客,码农之苦,说了都是泪,废话不多说,直接本主题,经过之前三篇的讲述,ios开发的东西大家或多 ...
- 【JS】374- 重学 this 关键字
为什么要学习this关键字 1. 面试会问啊!总有一些面试官喜欢问你一段不可能这么写的代码.看一道经典且古老的面试题(学完本文后,文末会有一道更复杂的面试题等着你哦!) 代码如下: let a = 5 ...
- 纯净版SSM
pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w ...
- JAVA 锁的终极状态
自旋锁 背景:互斥同步对性能最大的影响是阻塞,挂起和恢复线程都需要转入内核态中完成:并且通常情况下,共享数据的锁定状态只持续很短的一段时间,为了这很短的一段时间进行上下文切换并不值得. 原理:当一条线 ...
- 自动化运维之SaltStack实践
自动化运维之SaltStack实践 1.1.环境 linux-node1(master服务端) 192.168.0.15 linux-node2(minion客户端) 192.168.0.16 1.2 ...
- 《一头扎进》系列之Python+Selenium框架设计篇3- 价值好几K的框架,狼来了,狼来了....,狼没来,框架真的来了
1. 简介 前边宏哥一边一边的喊框架,就如同一边一边的喊狼来了!狼来了!.....这回是狼没有来,框架真的来了.从本文开始宏哥将会一步一步介绍,如何从无到有地创建自己的第一个自动化测试框架.这一篇,我 ...
- Spring Boot 打成的 jar 和普通的 jar 有什么区别 ?
Spring Boot 打成的 jar 和普通的 jar 有什么区别 ? Spring Boot 打成的 jar Spring Boot的项目终止以jar包的形式进行打包,这种jar包可以通过可以通过 ...