Udostępnij za pomocą


Błąd kompilatora C3903

"właściwość": nie ma ustawionej ani get metody

Uwagi

Właściwość musi mieć co najmniej metodę getset lub . Aby uzyskać więcej informacji, zobacz właściwość.

Example

Poniższy przykład generuje kod C3903:

// C3903.cpp
// compile with: /clr
ref class X {
   property int P {
      void f(int){}
      // Add one or both of the following lines.
      // void set(int){}
      // int get(){return 0;}
   };   // C3903

   property double Q[,,,,] {
      void f(){}
      // Add one or both of the following lines.
      // void set(int, char, int, char, double, double){}
      // double get(int, char, int, char, double){return 1.1;}
   }   // C3903
};