当前位置:范文都 > 简历 > 求职简历 > 笔试题目 > 阿尔卡特的一个笔试题
手机版

阿尔卡特的一个笔试题

来源:范文都 阅读:1.55W 次

阿尔卡特的一个笔试题

: defines the entry point for the console application.

//参数传递问题

include stdafx.h include iostream

using namespace std;

void fun(int a,int*b,int c,int* d)

{

a ;

(*b) ;

b = new int(10);

coutaaaa bendl;//地址

coutbbbb *bendl;//5

c ;

d ;

d = new int(5);

coutdddd dendl;//地址

coutdddd2 *dendl;//5

}

int main(int argc, char* argv[])

{

int a=2,b=3,c=4,d=5;

int* p = d;

fun(a,b,c,p);

coutaendl;//2 值传递

coutbendl;//4 指针传递

coutcendl;//5 引用传递

coutdendl;//5 引用传递 指向指针的引用

cout*pendl;//10 引用传递 int(5)为整型初始化

// printf(hello world!);

return 0;

}

本文链接:https://www.fanwendu.com/qzjlfw/bishi/wd06rr.html

Copyright © 2024. 范文都 All right reserved. 黑ICP备20085142号-2

文字美图素材,版权属于原作者。部分文章内容由网友提供推送时因种种原因未能与原作者联系上,若涉及版权问题,敬请原作者联系我们,立即处理。