[Prev][Next][Index]

initializing class variables




Sage team,


pC++2dep produces an "error: member function not found3" when I try to
initialize class variables.  Here is an example program:

______________________
#include <stdio.h>
 
struct X {
  static int a;
};
 
int X::a = 1;  // this line produces an error
 
main(){
  printf("a has the value %d\n", X::a);
}
______________________

This is standard C++ from p.150 of Stroustrup (hardcover).  Is this a
known bug?   Please let me know.


Thanks,
Lance Tokuda
unicron@cs.utexas.edu