- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't seem to find an answer on the web for this..
Is there a way to alias a type like in c without creating a derived type?
In C
typedef float Vec4[4];
Now Vec4 is aliased to an array of 4 floats
What is it in Fortran? (without using a derived type)
As always thanks ahead of time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran does not have type aliasing. There has been some discussion of it at the standards committee, but not everyone likes the idea.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran does not have type aliasing. There has been some discussion of it at the standards committee, but not everyone likes the idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
A suggestion you may bring up at the next standards committee that is but one way to provide for handling his is to suggest an anonymous user defined type.
************** for anyone reading this, the following is NOT part of the Fortran language **********
type Vec4
real :: (4) ! note lack of member variable name
end type Vec4
...
type(Vec4) :: fido
...
fido = [1.0,2.0,3.0,4.0]
...
do I=1,4
fido(I) = I
end do
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page