Linux C often confuses the concept

Source: Internet
Author: User

pointer function and function pointer

指针函数是指带指针的函数,即本质是一个函数。函数都有返回类型(假设不返回值,则为无值型),仅仅只是指针函数返回类型是某一类型的指针。

定义格式类型名 *函数名(函数參数列表)

函数指针是指向函数的指针变量。因而“函数指针”本身首先应是指针变量,仅仅只是该指针变量指向函数。定义格式返回值类型 (*指针变量名)(形參列表)

Pointer array and array pointer

指针数组数组元素全为指针的数组称为指针数组定义格式类型名 *数组标识符[数组元素个数
数组指针数组指针是指向数组地址的指针,其本质为指针声明格式类型名 (*指针变量名)[数组元素个数]

Constant pointer and pointer constant

常量指针常量指针本质是真正,而且这个指针是指向一个常量的指针。(地址能够变,内容不可又一次赋值。内容的改变仅仅能通过改动地址指向而改变)定义格式constconst *变量名
指针常量指针常量的本质是一个常量。而且使用指针来修饰它。

(地址不可改变。内容能够改变,必须初始化。地址尾随一生)定义格式类型名 *const 变量名

ps:* (pointers) and const (constants) who read before who; * symbolizes the address. The const symbolizes the content, and whoever is in front disagrees with the change.

Linux C often confuses the concept

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.