| class stack { char s[SIZE]; char* min; char* top; char* max; void new(); public: void push(char); char pop(); }; |
| ostream& operator<<(ostream&s, const complex& z) { return s << '(' << z.real() << ',' << z.imag() << ')'; } |
| class TGDIDemoWindow : public TMDIFrame { public: TGDIDemoWindow( LPSTR ATitle, LPSTR MenuName ) : TMDIFrame(ATitle, MenuName) {}; virtual void SetupWindow(); virtual void ArtyDemo( TMessage& ) =[CM_FIRST + ArtyDemoID]; virtual void Quit( TMessage& ) =[CM_FIRST + QuitID]; virtual void WMTimer( TMessage& ) =[WM_FIRST + WM_TIMER]; virtual void WMDestroy( TMessage& ) =[WM_FIRST + WM_DESTROY]; }; |
| // Example for BEGIN_MESSAGE_MAP BEGIN_MESSAGE_MAP( CMyWindow, CFrameWnd ) ON_WM_PAINT() ON_COMMAND( IDM_ABOUT, OnAbout ) END_MESSAGE_MAP( ) |
| C++中的内联函数(inline) |
| C++ 中重载 + 操作符的正确方法 |
| Symbian开发环境Carbide C++的配置和使用 |
| 在C++中创建并使用Web服务 |
| C语言之内存使用 |
| C++程序设计语言编程风格演变史 |
| C++数据结构学习:二叉树(4) |
| C++ 中的Singleton 类的实现讨论 |
| C语言之编译器引出的问题详解 |
| C语言之指针:基础 |
| template <class InputIterator, class T> InputIterator find(InputIterator first, InputIterator last, const T& value) { while (first != last && *first != value) ++first; return first; } |
| class ATL_NO_VTABLE CMyATLObj : public IMyATLObj, public IpersistStreamInitImpl <CMyATLObj>, public IOleControlImpl<CMyATLObj>, public IOleObjectImpl<CMyATLObj>, public IoleInPlaceActiveObjectImpl <CMyATLObj>, public IViewObjectExImpl<CMyATLObj>, public IoleInPlaceObjectWindowlessImpl <CMyATLObj>, public IPersistStorageImpl<CMyATLObj>, public IspecifyPropertyPagesImpl <CMyATLObj>, public IQuickActivateImpl<CMyATLObj>, public IDataObjectImpl<CMyATLObj>, public IProvideClassInfo2Impl <&__uuidof(CMyATLObj), NULL>, public CComControl<CMyATLObj> ...... |
| class delUser: public KDialogBase { Q_OBJECT public: delUser(KUser *AUser, QWidget *parent = 0, const char *name = 0); bool getDeleteHomeDir() { return m_deleteHomeDir->isChecked(); } bool getDeleteMailBox() { return m_deleteMailBox->isChecked(); } private: QCheckBox *m_deleteHomeDir; QCheckBox *m_deleteMailBox; }; |
| %:include <iostream> using namespace std; %:define MAX 5 void main() <% int m<:MAX:>; int i = 1; for (i = 0; i < MAX; i++) <% m<:i:> = i; if (i not_eq 3 and i < 5) cout << i << endl; %> %> |
| class TFormClrDlg : public TForm { published: // IDE-managed Components TColorDialog *ColorDialog; TButton *Button; TPanel *Panel1; void fastcall ButtonClick(TObject *Sender); private: // User declarations public: // User declarations virtual fastcall TFormClrDlg(TComponent* Owner); }; |
| #using <mscorlib.dll> using namespace System; using namespace System::Reflection; using namespace System::Security::Permissions; public __value enum SomeStuff { e1 = 1, e17 = 17 }; [attribute(AttributeTargets::Class, AllowMultiple=true)] public __gc class ABC { public: ABC(int __gc[]) {} ABC() {} ABC(int) {} ABC(int, float) {} ABC(SomeStuff) {} ABC(String*) {} int rgnField __gc []; double rgdField __gc []; double dField; }; |