CompuServe Thread

#Static Data Structures

2 messages in this thread
#18245From: Steve FaiwiszewskiOct 23, 1988 1:01 PM
Modula-2 also have "static" variables, but they are global within a module. They may not be as handy as C's "static" but they're practically as good. I don't really see any significant difference. – Steve –
#18272From: Don Curtis/SYSOPOct 23, 1988 3:15 PM
Steve, In C, if you declare a static variable within a module (vs a declaration within a function)…they are 'visible' to any function within that module, but 'invisible' to any functions outside that module. If you declare a static variable within a function, it is 'visible' only within that function (as are all other local variables). I know nothing about Modula-2, so don't know if this matches or doesn't their use of static variables. Don