由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - Fortran + C++
相关主题
Re: a question about fortranWhy do I need to use "plain" pointer?
[合集] 在VC++中怎样判断一个pointer是否valid?is smart_ptr really that good?
[转载] matlab里面移动指针pointer问题pointer overflow
anyone doing molecular computing and programming?C++ Q05: pointer to constant variable
a C language question regarding pointer usageC++ Q93 - Q95 (转载)
一个简单的java题int F::*x = &F::x是什么意思?
C++ Q93 - Q95c++ 里用到pointer 的地方我们尽可能用smart pointer吗?
谁对design pattern比较熟?不如各位高手挑个专题讲讲C++11吧
相关话题的讨论汇总
话题: c++话题: fortran话题: reference话题: passing话题: pointers
进入Computation版参与讨论
1 (共1页)
h****t
发帖数: 160
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.
s**i
发帖数: 381
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.

h****t
发帖数: 160
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

s***t
发帖数: 113
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.

s***t
发帖数: 113
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.

1 (共1页)
进入Computation版参与讨论
相关主题
不如各位高手挑个专题讲讲C++11吧a C language question regarding pointer usage
Go adopts JavaScript’s idea of semicolon insertion一个简单的java题
问个c调用fortran函数的问题C++ Q93 - Q95
Fortran 90 中稀疏矩阵读取,什么样的数据结构实现最快谁对design pattern比较熟?
Re: a question about fortranWhy do I need to use "plain" pointer?
[合集] 在VC++中怎样判断一个pointer是否valid?is smart_ptr really that good?
[转载] matlab里面移动指针pointer问题pointer overflow
anyone doing molecular computing and programming?C++ Q05: pointer to constant variable
相关话题的讨论汇总
话题: c++话题: fortran话题: reference话题: passing话题: pointers