- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Two easy questions
First one:
Is there a difference between the following two character declarations
character :: text*80
character(len=80) :: text
second one:
can I declare a character also as allocatable ?
Thanks
First one:
Is there a difference between the following two character declarations
character :: text*80
character(len=80) :: text
second one:
can I declare a character also as allocatable ?
Thanks
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. There's no difference
2. Yes and no. You can declare an array of character(LEN=fixed_len) to be allocatable, but in F95 characters cannot have allocatable length. Allocatable-length characters will be part of Fortran 2003 (draft is available here). Intel plans are to add F2003 features gradually -- Steve could perhaps tell you better when is this one "scheduled".
Currently, in F95, character(1), allocatable:: can do for certain purposes, but its semantics is different and they're far less useful than real strings, and future character(len=:) feature.
There are also several implementations of ISO_VARYING_STRINGS module on the net -- Google 'em.
Jugoslav
2. Yes and no. You can declare an array of character(LEN=fixed_len) to be allocatable, but in F95 characters cannot have allocatable length. Allocatable-length characters will be part of Fortran 2003 (draft is available here). Intel plans are to add F2003 features gradually -- Steve could perhaps tell you better when is this one "scheduled".
Currently, in F95, character(1), allocatable:: can do for certain purposes, but its semantics is different and they're far less useful than real strings, and future character(len=:) feature.
There are also several implementations of ISO_VARYING_STRINGS module on the net -- Google 'em.
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