C语言-指针,

初学C语言,以下是我的学习比较,有错误以后更正。

指针:理解两个符号的定义是关键。

&:gives the address of an object,

*:The unary operator * is the indirection or dereferencing operator; when applied to a pointer, it accesses the object the pointer points to.

int *p; 其实就是p指向的对象是int类型。

Since C passes arguments to functions by value, there is no direct way for the called function to alter a variable in the calling function.

C语言并不像JAVA一直传参的过程改变自身的值。C语言传递的参数是自己的副本。那么如何传递参数本身呢?

void swap(int *px, int *py)

这个时候函数里面的参数,我会感到迷惑,参数是*px吗?仔细想想不是,应该是指针px.     注: int *px 申明指针   *px = a 指针取值运算   px = &a 指针赋值运算。


C语言编译:

a stack is a data structure where values can be added or deleted, but only according to a “last-in, first-out” discipline. A stack can be implemented as an array, where we always insert and remove elements from one end of the array. This end is called the top of the stack. With IA32, the program stack is stored in some region of memory. the stack grows downward such that the top element of the stack has the lowest address of all stack elements. The stack pointer %esp holds the address of the top stack element. 




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值