module def
type,public:: ta
integer::a,b
end type ta
type,public::tb
type(ta)::c,d
end type tb
end module def
program main
use def
implicit none
type(tb)::c
c%c%a=1
c%c%b=2
c%d%a=3
c%d%b=4
write(unit=*,fmt=*) c
stop
end program main
RESULTS (http://www.lahey.com ELF90):
1 2 3 4
Regards
G.Bottoni
http://icil64.cilea.it/~bottoni/
In 09.37 05/07/01 +0800, hai scritto:
>Dear All:
>
>There are a program in C as following:
>stsruct A{
> int a,b;
>};
>struct B{
>A c,d;
>};
>void main ()
>{
>B C;
>C.c.a=1;
>C.c.b=1;
>C.d.a=1;
>C.d.b=1;
>return;
>}
>
>How can I transform it to Fortran90?
>
>Thanks;
>Wen Chu
>
>
>
>
>
>
>--http://www.eyou.com
>--稳定可靠的免费电子信箱 语音邮件 移动书签 日历服务 网络存储...亿邮未尽
>
|