Arrays of pointers
AmadanMath_at_gmail.com
Date: 01/27/05
- Next message: glen herrmannsfeldt: "Re: Arrays of pointers"
- Previous message: Richard E Maine: "Re: a strange thing when I write data into a file"
- Next in thread: glen herrmannsfeldt: "Re: Arrays of pointers"
- Reply: glen herrmannsfeldt: "Re: Arrays of pointers"
- Reply: Richard E Maine: "Re: Arrays of pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Jan 2005 08:20:32 -0800
Hello.
I am rather new at FORTRAN, and I have a problem with the type system
(F90). I have a binary tree type:
TYPE tree
TYPE (tree), POINTER :: left, right
...
END TYPE tree
and I usually do:
TYPE (tree), POINTER :: my_tree
my_tree => build_tree(...)
where new_tree allocates space for it and constructs the tree. Now I
need several trees in a dynamically allocated array, but I cannot make
an array of pointers. I could probably refactor my code so that
build_tree works on an already allocated object, so that it does not
require a pointer, but is there some way I could really have an
(allocatable) array of pointers to my structure?
Thanks a lot.
Goran Topic
- Next message: glen herrmannsfeldt: "Re: Arrays of pointers"
- Previous message: Richard E Maine: "Re: a strange thing when I write data into a file"
- Next in thread: glen herrmannsfeldt: "Re: Arrays of pointers"
- Reply: glen herrmannsfeldt: "Re: Arrays of pointers"
- Reply: Richard E Maine: "Re: Arrays of pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|