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. DAO接口及实现类

    DAO接口中定义了所有的用户操作,如添加记录.删除记录及查询记录. package chapter13; import java.util.*; public interface UserDAO { ...

  2. python知识点记录(一):

    1.如何使print输出不换行: 在print语句末尾加上一个英文逗号. 2.安装第三方模块时,用pip和easy_install是一样的.下载一个setuptools.exe安装好就有easy_in ...

  3. lnmp 在nginx中配置相应的错误页面error_page

    1. 创建自己的404.html页面 2.更改nginx.conf在http定义区域加入: fastcgi_intercept_errors on; 3.更改nginx.conf(或单独网站配置文件, ...

  4. 《C与指针》第七章练习

    本章问题 1.具有空函数体的函数可以作为存根使用,你如何对这类函数进行修改,使其更有用? answer:Have the stub(存根) print out a message when it is ...

  5. 区间更新 zoj3911

    哎,没什么坑点,一个简单的区间更新题,但是改了好几天没改对,最终还是过了~~发个纪念下 泪奔... #include<cstdio>#include <iostream>#in ...

  6. 安装配置sock5代理

    环境准备及安装 yum -y install pam-devel openldap-devel cyrus-sasl-devel yum -y install openssl-devel.x86_64 ...

  7. 在C#中使用C++编写的类

    现在在Windows下的应用程序开发,VS.Net占据了绝大多数的份额.因此很多以前搞VC++开发的人都转向用更强大的VS.Net.在这种情况下,有很多开发人员就面临了如何在C#中使用C++开发好的类 ...

  8. maven 几个插件的使用

    1.  compile <plugin> <artifactId>maven-compiler-plugin</artifactId> <configurat ...

  9. Sedgewick的红黑树

    红黑树一直是数据结构中的难点,大部分关于算法与数据结构的学习资料(包括<算法导论>)对于这部分的讲解都是上来就下定义,告诉我们红黑树这个性质那个性质,插入删除要注意1234点,但是基本没有 ...

  10. WCF JSON DATETIME JSON.NET (Newtonsoft.Json.dll)

    [DataMember] public DateTime? myTime { get; set; } var timeFormat = new JsonSerializerSettings() { D ...