The function return
来源:互联网 发布:ubuntu 中启动网络服务 编辑:程序博客网 时间:2024/05/01 23:45
Stack during Subroutine Call
基本知识: http://www.cs.virginia.edu/~evans/cs216/guides/x86.html
#include <iostream>
using namespace std;
/*Function to return struct */
struct A
{
int ma;
int mb;
int mc;
int md;
int me;
};
struct A fun(void)
{
struct A a1;
a1.ma = 1;
a1.mb = 2;
a1.mc = 3;
a1.md = 4;
a1.me = 5;
return a1;
}
class B
{
public:
B() { cout << "hello"<<endl;}
B(B& b) { i = b.i;cout << "hello"<<endl;}k
~B() {cout << "bye" <<endl;}
int i;
};
/*Function to return class */
B fun2(void)
{
B b;
b.i = 1;
return b;
}
int main(int argc,char *agrv[])
{
//test the struct return
struct A a2;
a2 = fun();
//test class return and initialize the class variable
B b2= fun2();
//test class return and assign the class variable
B b3;
b3 = fun2();
return 0;
}
- The function return
- About the return value of SetTimer function
- x86 function call and return --- stack save the return address.
- JavaScript function return function..
- Function Return Table
- JS Function中的return
- return alert from function
- return this.each(function(){})
- function 中return方法
- break,continue,return in function
- syntaxerror: 'return' outside function 解决办法
- python:'return' outside function 错误
- The return of king
- The king return
- Return of the Nim
- Return of the Nim
- function should return a value; 'void' return type assumed
- return confirm Cannot return from outside a function or method
- 基于四叉树的LOD地形场景的怪异优化探索
- VolumeSet agent
- SharePoint WebService
- 网站变灰(包括flash)css代码
- 关于component持久化心得
- The function return
- 在eclipse上装python的步骤!一定要记得!对于初学者来说很有用!
- DELPHI 的ORM
- SP5368+GC0309调试
- Vmware+redhat9 的问题:could not open virtual machine
- String,CString,TCHAR,char间区别和联系以及相互转化 【转】
- windows上安装VIM插件DrawIt!
- C++中的const和mutable
- web验证用户登录状态