Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Q about passing array boundaries or sizes

$
0
0

Suppose I have this:

integer x(100)

call xprint(x(23:70) )

end

subroutine xprint(x)

integer x(*)

end subroutine

Normally I would have to ALSO tell it how many elements of X to print.

But I was wondering if there is a subroutine call that would actually tell me how many elements I am passing?

UBOUND and SIZEOF do not work here. I get a compiler error.

If I tell the internal subroutine a fixed number of elements, x(1:20) for example,

then it will use that number, and does not know any thing about the actual size passed to it.

 

Maybe that is a future enhancement?

 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>