Estructuras

Veamos una simple estructura de C, que sigue siendo válida en C++:
  struct mexican{
    bool tasty;
    int color;
    int rating;
    float cooktime;
  }

Ahora utilicémosla en un programa:
  main()
  {
   mexican lunch;

   lunch.tasty = false;
   lunch.color = 0;
   lunch.rating = 0;
   lunch.cooktime = 5542.2;

   cout << "Status of my lunch:" << '\n';

   if (lunch.cooktime > 5000)
      cout << "I wouldn't know, I'm waiting for it!\n";
   else
      cout << "Yuck! *Barf* Yech eeww!\n";
  }

Primero se crea lunch, del tipo mexican