Re: Static Objects as Struct Members

From: Aslan Kral (aslanski2002_at_yahoo.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 16:37:10 +0200


"pmatos" <pocm@sat.inesc-id.pt>, haber iletisinde sunlari
yazdi:1109341852.271473.11380@g14g2000cwa.googlegroups.com...
> That way won't work because rules will not be a static member of my
> struct. Even if inside my struct I add your code, I'll have defined
> staticrules which will be useless since it was defined only to define
> rules.
>
There is no static member in the code. That answers your question regarding
initializing the map before main() is entered. Of course you can do it some
other ways too.



Relevant Pages

  • Re: static into structure
    ... You're asking why a C++ features is not supported by C; that is, in principle, no different from asking why a given Fortran feature is not supported by C. ... "As having a static member variable in a c++ class means that it is ... be common to all instances of that struct." ... This is probably because the scope of struct member names is different in C from the class scope that they have in C++. ...
    (comp.lang.c)
  • Re: Static Declarations
    ... as far as considering a static member a way to create a 'namespace' that was ... A struct in meant to be a collection of related, ... data types which are realized when the struct is 'instantiated'. ...
    (comp.lang.c)
  • Re: static into structure
    ... Snip them along with anything else ... "As having a static member variable in a c++ class means ... A static member inside a struct will be common to all ...
    (comp.lang.c)
  • Re: static into structure
    ... objects of that class,I assumed something like, A static member ... be common to all instances of that struct." ...
    (comp.lang.c)
  • Re: static into structure
    ... arnuld writes: ... + class means that it is common to all objects of that class,I assumed ... A static member inside a struct will be common to all ...
    (comp.lang.c)