Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Visual C++: Comment accéder aux méthodes statique d’une classe


{filelink=13221}

#include "stdafx.h"
using namespace System;
 
class MembreStatic
{
private:
    const static Int32 x = 42;
public:
   static Int32 get_x()
   {
      return x*10;
   }
};
 
Int32 main()
{
    Console::WriteLine ( MembreStatic::get_x() );
	Console::ReadLine();
    return 0;
}

No comments yet.

Leave a Comment