/*
============================================================================
Name : hello.c
Author : liming
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/ #include <stdio.h>
#include <stdlib.h> void fun(int m, char * (*p)[5])
{
int i = 0;
char ** buff = (char**)p;
char **tm = NULL; for (i=0; i<m; i++)
{
tm = buff + i;
//printf("%s\n", *(buff+i));
printf("%s\n", *(tm));
}
} int main(void)
{
char * buf[]= {"aa", "bb", "cc", "dd", "ff"};
char * ptr = NULL;
char a = 9;
ptr = &a;
ptr++;
ptr++;
ptr++;
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ fun(sizeof(buf)/4, &buf); printf("sizeof(buf)/4 = %d\n", sizeof(buf) / sizeof(buf[0]) ); return 0;
}
!!!Hello World!!!
aa
bb
cc
dd
ff
sizeof(buf)/4 = 5 Terminated with return code 0
Press any key to continue ...

C语言数组,指针小案例的更多相关文章

  1. 关于C语言数组的小练习--笔记

    #include <stdio.h> #include <windows.h> #include <mmsystem.h> #include <string. ...

  2. c语言——数组指针和通过指针引用数组元素的方法总结

    1.数组指针:即指向数组的指针 那么, 如何声明一个数组指针呢?int (* p)[10]; /*括号是必须写的,不然就是指针数组:10是数组的大小*/1拓展:有指针类型元素的数组称为指针数组. 2. ...

  3. C语言数组指针

    C语言中的数组指针与指针数组: ·数组指针一.区分 首先我们需要了解什么是数组指针以及什么是指针数组,如下: int *p[5];int (*p)[5];数组指针的意思即为通过指针引用数组,p先和*结 ...

  4. C语言-数组指针与指针数组

    1.思考 下面这些声明合法吗? int array[5]; int matrix[3][3]; int * pa = array; int * pm = matrix; 问题: array代表数组首元 ...

  5. C语言数组指针(指向数组的指针)

    注意:数组指针的定义,与指针数组的区别 转载:http://c.biancheng.net/cpp/biancheng/view/162.html 指向多维数组元素的指针变量 ① 指向数组元素的指针变 ...

  6. c语言指针数组与数组指针

    一.指针数组和数组指针的内存布局初学者总是分不出指针数组与数组指针的区别.其实很好理解:指针数组:首先它是一个数组,数组的元素都是指针,数组占多少个字节由数组本身决定.它是“储存指针的数组”的简称.数 ...

  7. C语言学习笔记 (007) - 数组指针和通过指针引用数组元素的方法总结

    1.数组指针:即指向数组的指针 那么, 如何声明一个数组指针呢? ]; /*括号是必须写的,不然就是指针数组:10是数组的大小*/ 拓展:有指针类型元素的数组称为指针数组. 2.通过指针引用数组元素的 ...

  8. C++语言中数组指针和指针数组彻底分析

    #################################                              ##       基本知识               ##        ...

  9. C++基础 (8) 第八天 数组指针 模板指针 C语言中的多态 模板函数

    1昨日回顾 2 多态的练习-圆的图形 3多态的练习-程序员薪资 4员工管理案例-抽象类和技术员工的实现 employee.h: employee.cpp: technician.h: technici ...

随机推荐

  1. boost intrusive

    1. the advantages of intrusive container (1) Intrusive containers don't allocate memory dynamically. ...

  2. Angular JS - 9 - SeaJS加载js模块

    seajs加载模块的三种方式 1.seajs.use() 加载入口模块,类似于Java的main函数 2.require:      当在一个模块中需要用到其它模块时一般用require加载 1)   ...

  3. Python爬虫之抓取豆瓣影评数据

    脚本功能: 1.访问豆瓣最受欢迎影评页面(http://movie.douban.com/review/best/?start=0),抓取所有影评数据中的标题.作者.影片以及影评信息 2.将抓取的信息 ...

  4. wamp环境的搭建

    本文详细介绍了在Windows2003下使用Apache2.2.21/PHP5.3.5/Mysql5.5.19/phpMyAdmin3.4.9搭建php开发环境. 第一步:下载安装的文件 1. Apa ...

  5. Alex and Number

    Alex and Number 时间限制: 1 Sec  内存限制: 128 MB提交: 69  解决: 12[提交][状态] 题目描述 Alex love Number theory. Today ...

  6. UILabel How to set background image

    UILabel *myLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 20)]; UIImage *img = [UIImage ...

  7. linux从head.s到start_kernelstart_kernel之---内核重定位后分析

    参考: https://biscuitos.github.io/blog/ARM-BOOT/ zImage 重定位之后实践 zImage 重定位之后,ARM 将 pc 指针指向了重定位 zImage ...

  8. apt-cyg for Cygwin(setup-x86_64 .exe )在win10下的安装

    cygwin安装后,如果没有选择安装所有包(这会占用5G空间,很多包不需要),再需要安装新的包,可以启动setup-x86_64 .exe(我把它放置在C:\cygwin64目录下),添加包(如wge ...

  9. 嵌入式C语言4.1 C语言内存空间的使用-指针

    指针:就是内存资源的地址.门牌号的代名词 假如你所在的城市是一个内存(存储器),如果找到你家,就是通过你的家庭住址(指针)寻找,而你家里的摆设面积之类的就是内存的内容(指针指向的内容). 指针变量:存 ...

  10. HTML页面隐藏值

    <input id="menuId" type="hidden"  hidden="hidden" />