avatar
h*t
1
Fortran calls C++ functions:
in Fortran, the arguements are passed by reference,
in C++ prototype, the arguements can be declared as
pointer generally. I also tried passing reference in C++,
it works. (Here only consider a single unit built-in data type, e.g. real,
integer)
My question is: why it works for both passing reference and passing pointer?
(ONLY test on FC4, intel fc/cc 9.0)
Gao shou qing jie shi yi xia.....
3x.
avatar
s*i
2
IMHO, reference is essentially the same as pointers, since it is passing the
address not the value

【在 h****t 的大作中提到】
: Fortran calls C++ functions:
: in Fortran, the arguements are passed by reference,
: in C++ prototype, the arguements can be declared as
: pointer generally. I also tried passing reference in C++,
: it works. (Here only consider a single unit built-in data type, e.g. real,
: integer)
: My question is: why it works for both passing reference and passing pointer?
: (ONLY test on FC4, intel fc/cc 9.0)
: Gao shou qing jie shi yi xia.....
: 3x.

avatar
h*t
3
why lots of programmer are using pointer instead of reference?
I think refernece is better than pointer if only passing int, double ... data
type.

【在 s**i 的大作中提到】
: IMHO, reference is essentially the same as pointers, since it is passing the
: address not the value

avatar
s*t
4
It looks nicer to use reference than pointers, plus you do not need to
dereference pointers all the time.

data

【在 h****t 的大作中提到】
: why lots of programmer are using pointer instead of reference?
: I think refernece is better than pointer if only passing int, double ... data
: type.

avatar
s*t
5
It looks nicer to use reference than pointers, plus you do not need to
dereference pointers all the time.

data

【在 h****t 的大作中提到】
: why lots of programmer are using pointer instead of reference?
: I think refernece is better than pointer if only passing int, double ... data
: type.

相关阅读
美东药厂分子动力学暑假实习CCF Lead Web Developer opening加州招cloud方面人才,高薪!高薪!诚求审稿机会PHP Web Developer Co-op OpportunityExcel VBA 编码问题,请高手帮忙!即将回国,整理这几年下来不少东西,出售生活用品,家具朋友start-up公司招part-time software developerC++ 模板的技术问题这里有做optimization的么?请教个问题。PhD student positions at <a class="__cf_email__" href="/cdn-cgi/l/email-protection" data-cfemail="bffafafcecffead1d6c9dacdccd6cbc6">[email protected]</a><script data-cfhash='f9e31' type="text/javascript">/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */</script> of California, Merced请教: 阿里达摩院 的压缩,计算机视觉和 AI 融合Java opportunity请感兴趣的同学直接联系老师祝大家新春快乐,猴年大吉!infosys 和解之后用什么签证哪请教计算机博士学位学校排名南加州附近 4月-6月之间有会议吗PhD Positions in Data Mining适合数学好想换方向的存储领域小牛诚挚招聘研究员或博士后
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。