C 日记目录

C basics ................

writing Numeration

storage   , structor space assigning

pointer,  array

others

___________________________________-

c coding

1. define empty pointer

#define NULL  ((void*)0)

应用程序是不能访问0地址的,所以可以用0地址来表示一个空指针。

利用指针之前(例如作为形参的指针)需确保该指针有效:

if( ptr != NULL)

2, define fucntion pointer type

typedef void (*pf)(void*)

//函数名本来就是地址

____strlen()  //字符串的长度不包括 '\0'.

sizeof("hello") 长度包括 '\0'.

__________________________________

数组和指针

int *pT;

int  a[5] = {0};

____指针当作数组用. 如果你不需要改变这个指针而要用到它为索引的数,用数组的格式来调用这个数。

aBuf[i] =pT[i];

____数组a[5],编译器编译后,

1,a+1 为 a + 1*sizeof(int).  // a[0]+1*sizeof(a[0])

2,&a 为&a[0],//就是a

3,&a+1,  a 是数组,类型为 int(*)[5], a + sizeof(a) = a + 5*sizeof(int)

___指针能够有自己的地址: &pT. 和数组不同,上面2,&a 就是a.

___ lsearch 中的应用

 char *key = "rabbit";  //key[] wrong
http://www.cnblogs.com/aprilapril/p/4333173.html

C basics的更多相关文章

  1. Assembler : The Basics In Reversing

    Assembler : The Basics In Reversing Indeed: the basics!! This is all far from complete but covers ab ...

  2. The Basics of 3D Printing in 2015 - from someone with 16 WHOLE HOURS' experience

    全文转载自 Scott Hanselman的博文. I bought a 3D printer on Friday, specifically a Printrbot Simple Metal fro ...

  3. Cadence UVM基础视频介绍(UVM SV Basics)

    Cadence关于UVM的简单介绍,包括UVM的各个方面.有中文和英文两种版本. UVM SV Basics 1 – Introduction UVM SV Basics 2 – DUT Exampl ...

  4. Xperf Basics: Recording a Trace(转)

    http://randomascii.wordpress.com/2011/08/18/xperf-basics-recording-a-trace/   This post is obsolete ...

  5. Xperf Analysis Basics(转)

      FQ不易,转载 http://randomascii.wordpress.com/2011/08/23/xperf-analysis-basics/ I started writing a des ...

  6. Radio Basics for RFID

    Radio Basics for RFID The following is excerpted from Chapter 3: Radio Basics for UHF RFID from the ...

  7. 【IOS笔记】View Controller Basics

    View Controller Basics   视图控制器基础 Apps running on iOS–based devices have a limited amount of screen s ...

  8. NSInvocation Basics

    In this article I'm going to cover the basics and usages of NSInvocation. What is NSInvocation? Appl ...

  9. Qt 线程基础(Thread Basics的翻译,线程的五种使用情况)

    Qt 线程基础(QThread.QtConcurrent等) 转载自:http://blog.csdn.net/dbzhang800/article/details/6554104 昨晚看Qt的Man ...

随机推荐

  1. Scalding初探之三:Hadoop实战

    Java版本 如果在Scala工程中混入Java类导致java版本不match,可能会抛错 java.lang.UnsupportedClassVersionError: XXX Unsupporte ...

  2. svn Q&A

    Q1:在svn commit的时候,会出现某某文件 is missing.这是因为此次提交时:远程repository中并没有该文件,而且本地repository也没有该文件. 具体原因: 1.可能因 ...

  3. TCP发送接口的返回值

    原文链接: http://blog.csdn.net/ordeder/article/details/17240221 1. TCP发送接口:send() TCP发送数据的接口有send,write, ...

  4. 由于xrdp、gnome和unity之间的兼容性问题,在

    由于xrdp.gnome和unity之间的兼容性问题,在Ubuntu 14.04版本中仍然无法使用xrdp登陆gnome或unity的远程桌面,现象是登录后只有黑白点为背景,无图标也无法操作.与13. ...

  5. 第八课,T语言功能和参数(版本5.0)

    功能的理解 功能是TC移动项目应用的基本模块,通过对功能模块的调用实现特定的功能.TC综合开发工具中的功能相当于其它高级语言的子程序,在其他高级语言中,比如C,C++中,称为函数.允许用户建立自己定义 ...

  6. Oracle创建、删除表空间、用户

    1.创建临时表空间 create temporary tablespace linshi tempfile 'e:\linshi.dbf' size 50m autoextend on next 50 ...

  7. 伪类after的使用

    .center-tc { text-align: center; position: relative; color:red; &:before{ content:''; width: 10p ...

  8. Vmvare下Ubuntu安装Python3.4

    Ubuntu14.4下默认安装的Python版本是2.7.随着Python3.4的使用,现在大部分Python开发者都喜欢使用Py3.4.那么Ubuntu下应该怎么安装Python3.4呢? (1). ...

  9. MindProject R6025解决

    -- 来之百度贴吧,收藏在此. 不知道吧里有没有人用mindmanager2012,如果用的话会发现保存.mmap文件后,移动到其他地方,再打开,就会出错,软件关闭.网上很多人说是模版里tips的原因 ...

  10. Mybatis知识点总结

    ---恢复内容开始--- Mybatis知识点总结 1.#{}和${}的区别是什么? 答:#{}的使用场景:在表的sql映射文件中如下使用: <mapper namespace="co ...