C++ global struct

Description

C++ global struct

#include <iostream>
using namespace std;
struct Date    // this is a global declaration
{
   int month;// w  w w  . ja v  a  2s .c  om
   int day;
   int year;
};
int main()
{
   Date birth;
   birth.month = 12;
   birth.day = 28;
   birth.year = 1986;
   cout << birth.month << '/' << birth.day  << '/' << birth.year << endl;
   return 0;
}



PreviousNext

Related