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. Android double输出时保留两位小数

    方法1,在代码中操作 this.totalTextview = (TextView) findViewById(R.id.package_total_money); double decimalBal ...

  2. 2015GitWebRTC编译实录13

    2015.07.21 libboringssl.a 编译通过主要是生成路径,去除test文件比较啰嗦,后继测试需要重点跟进下 CC obj/third_party/boringssl/boringss ...

  3. 手机自适应meta设置

    <meta name="format-detection" content="telephone=no"><meta name="v ...

  4. Windows Service 开发,安装与调试

    Visual Studio.net 2010 Windows Service 开发,安装与调试 本示例完成一个每隔一分钟向C:\log.txt文件写入一条记录为例,讲述一个Windows Servic ...

  5. 【转】C++怎么读写windows剪贴板的内容?比如说自动把一个字符串复制.

    // 复制数据至剪切板BOOL CopyToClipboard(const char* pszData, const int nDataLen){ if(::OpenClipboard(NULL)) ...

  6. 阻止事件冒泡两种方式:event.stopPropagation();和return false;

    jQuery提供了两种方式来阻止事件冒泡. 方式一:event.stopPropagation(); $("#div1").mousedown(function (event) { ...

  7. SQL Server 2008 收缩日志 清空删除大日志文件 转载

    SQL Server 2008 收缩日志 清空删除大日志文件 由于SQL2008对文件和日志管理进行了优化,所以以下语句在SQL2005中可以运行但在SQL2008中已经被取消:(SQL2005)Ba ...

  8. Linux下访问网站

    1.将打包的文件解压到/usr/local/tomcat7/webapps/ROOT下 2.将8080端口开启 3.通过浏览器访问,结果返回来的状态时Aborted,出现 严重: The web ap ...

  9. Asp.net MVC 之请求生命周期

    今天主要试着描述一下ASP.NET MVC 请求从开始到结束的整个生命周期,了解这些后,对MVC会有一个整体的认识. 这里主要研究了MVC请求的五个过程. 1.创建RouteTable 当ASP.NE ...

  10. Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)

    今天遇到一个项目中用到Android 6.0的系统,但是有个文件是从Assert目录下写到SDCard中,但是AndroidMinifest.xml中已经加了文件的读权限和写权限,异常日志是在创建文件 ...