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. windows调试器尝鲜

    曾几何时,我也下载过看雪论坛精华看的津津有味.可惜一直没有动手去调试,学到的x86汇编指令也忘得差不多了.最近将老机器的T4200 CPU换成了更省电,温度更低的P8800,为了支援新的VT虚拟化,特 ...

  2. Largest Number

    Given a list of non negative integers, arrange them such that they form the largest number. For exam ...

  3. Socket编程基础——面向连接TCP

    WinSock是Windows环境下的网络编程接口,它最初是基于Unix环境下的BSD Socket,是一个与网络协议无关的编程接口.WinSock包含两个主要版本,即WinSock1和WinSock ...

  4. StringMisc

    //StringMisc.java // This program demonstrates the length, charAt and getChars // methods of the Str ...

  5. js事件处理机制

    一.事件处理程序 a.     DOM0级事件处理程序,被认为是元素的方法. var btn=document.getElementById('myBtn'); btn.onclick=functio ...

  6. poj1458 Common Subsequence ——最长公共子序列

    link:http://poj.org/problem?id=1458 最基础的那种 #include <iostream> #include <cstdio> #includ ...

  7. ubuntu 使用wine卸载软件

    现在的网络应用许多被windows绑架了,有时候不得不下载一些.exe的的东西在ubuntu下载配合一下,但是后来我想卸载这些.exe应用程序,于是百度了一下,一位博主写的好,如下,晒出来: cd ~ ...

  8. 修改pc机的mac地址 以及 mac地址的组成

    在"开始"菜单的"运行"中输入regedit,打开注册表编辑器,展开注册表到:HKEY_LOCAL_ MACHINE/System/CurrentControl ...

  9. Hibernate getCurrentSession()和openSession()的区别

    通过getCurrentSession()创建的Session会绑定到当前线程上:openSession()不会. 通过getCurrentSession()获取Session,首先是从当前上下文中寻 ...

  10. ORM框架

    半自动:iBATIS是一个半自动化的ORM框架,需要通过配置方式指定映射SQL语句 全自:由框架本身生成(如Hibernate自动生成对应SQL来持久化对象),即Hibernate属于全自动ORM框架 ...