- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ihave two questions here:
(1)is therea class type style as in C++ in fortran, so that I can group some data type variables and functions together?
(2) is there any function pointer in fortran ?
If not, any suggestions on how to do it?
Thanks,
Emmy
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) Not by name. Some competing products such as from Lahey have class extensions from the Fortran 2003 standard. You might in some cases be able to sove the problem adequatelyusing derived types and modules.
2) Not until Fortran 2003, however some current compilershavesuch extensions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Fortran supports function pointers, though not using F2003 syntax.
You can do some class-like things with generics and defined operators. I've seen some good attempts at doing OO programming with Fortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran-9x is not an OO language, although many concepts can be used/emulated. Check out this list of articles. (Decyk/Norton/Szymanskiare the most prolific authors in this field, so I suggest checkingtheir articles first)
CVF/IVF have pointers-to-functions as an extension (not compatible with future F2003 standard). Check out e.g. MAPI module+sample on my home page to see how it's implemented.
Jugoslav
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page