Struct 2dpoint {Int x, y;}; struct 3dpoint: 2dpoint {int z;}; int main (void) {3DPOINT 3DP = {0 0, 1}, 2}; cerr << 3dp.x 3dp.y 3dp.z << Endl;}
===============================
#include ==================================== #include ========================= # include "iostream.h" #include "conoe.h" struct info {info () {MEMSET (this, 0, SIZEOF (INFO));} info (char * psztxt, int * pdwdata) {MEMSET (this, 0, sizeof (info)); m_psztxt = psztxt; m_pdwdata = pdwdata;} Virtual ~ info () {m_psztxt = 0 M_pdwdata = 0;} char * m_psztxt; int * m_pdwdata;}; void main () {char sztext [] = "Hello"; int dwdata = 128; info * pinfo = new info (sztext, & dwdata); delete pinfo; }