Groups
Groups
Sign in
Groups
Groups
gg95
Conversations
About
Send feedback
Help
Private Variables
0 views
Skip to first unread message
PGK
unread,
Nov 17, 2009, 4:47:20 AM
11/17/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gg95
Here's a silly wee puzzle. The solution is below. Why is there no
error produced from the assignment of 11 to y?
module m
integer, private :: y
end module m
program p
use m
y = 11
end program p
Module m's variable "y" is indeed private; the y being assigned 11, is
an implicit variable. Use "implicit none" to obtain a compiler error:
module m
integer, private :: y
end module m
program p
use m
implicit none
y = 11
end program p
Reply all
Reply to author
Forward
0 new messages