CWangChao

深入浅出,厚积薄发,有一技之长才能立足于一席之地!

博客园 首页 新随笔 联系 订阅 管理

2010年7月1日 #

摘要: #include "stdio.h"int function(int a,int b){int c=a+b;int i;for(i=0;i<50;i++){c=c+i;}return c;}void main(){function(1,2);} --- c:\users\wangchao\desktop\test\test\main.cpp -------------------------... 阅读全文
posted @ 2010-07-01 20:30 CWangChao 阅读(184) 评论(0) 推荐(0)

摘要: #include "stdio.h"int function(int a,int b){int c=a+b;return c;}void main(){function(1,2);getchar();} --- c:\users\wangchao\desktop\test\test\main.cpp -------------------------------#include "stdio.h"... 阅读全文
posted @ 2010-07-01 20:28 CWangChao 阅读(204) 评论(0) 推荐(0)

摘要: 函数调用约定在C语言中,假设我们有这样的一个函数:int function(int a,int b)调用时只要用result = function(1,2)这样的方式就可以使用这个函数。但是,当高级语言被编译成计算机可以识别的机器码时,有一个问题就凸现出来:在CPU中,计算机没有办法知道一个函数调用需要多少个、什么样的参数,也没有硬件可以保存这些参数。也就是说,计算机不知道怎么给这个函数传递参数,... 阅读全文
posted @ 2010-07-01 20:18 CWangChao 阅读(138) 评论(0) 推荐(0)