- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Visual Fortran 6.1 environment, I can't use pointersto developea LIFO stack of type data (a number, astring anda pointer to next data) likeI use in Pascal or C.Standard POINTER, TARGET and new Fortran 90/95 pointer features aren't suitable for a such simple problem. Do I needto use a mixed language? Thanks
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not? What goes wrong?
Do be aware that you are using a compiler that is six years old.
Do be aware that you are using a compiler that is six years old.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not a compiler problem. Probably it's a matter of my pointer's idea (and code too). Reading an input free format text file I describe a building or bridge (I need to analyse their dynamic behaviour on wind load with a finite element fortran written program). I don't know "a priori" how many points are in the structure, so I need to read the input file and create a list of element (then, before the computation, I allocate an array with right dimension). In CVF, I think, it's necessary allocate the target array (and pointer too), but I don't know dimension at the beginning of elaboration. In Pascal and C, each data element (type data) is allocated when needed and linked to previous element (the last in the list). Isthat possible also in CVF? Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Certainly it's possible in Fortran, and you'd do it the same way you would in Pascal or C - by allocating each "link" as needed, rather than an array all at once. In the old version you're using, you will have to use POINTER rather than ALLOCATABLE for the link to the next (or previous) element.

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