// Lab 8, Working with structs
// Programmer : Maiar Khattab
// Editor(s) used : Code Blocks 13.12
// Compiler(s) used : Code Blocks 13.12
#include<iostream>
using std:: cout ;
using std:: endl ;
#include<cstdlib>
//struct def
struct tod
{
int hour; // the hr , 0-23
int minute; // the min, 0-59
int second; //the sec, 0-59
char descr [ 32 ] ; //the description of the time of day
} ;
//void printTod(const tod&);
int main ( )
{
cout << "Lab 8, Working With structs\n " ;
cout << "Programmer: Maiar Khattab\n " ;
cout << "Editor(s) used: Code Blocks 13.12\n " ;
cout << "Compiler(s) used: Code Blocks 13.12\n " ;
cout << "File: " << __FILE__ << endl;
cout << "Complied: " << __DATE__ << " at " << __TIME__ << endl << endl;
tod theTime[ ] = { { 12 ,0 ,0 , "noon" } ,
{ 0 ,0 ,0 ," midnight" } ,
{ 6 ,00 ,00 ," supper " } ,
{ 11 ,30 ,0 ,"bedtime" } } ;
for ( int i; i < 5 ; i++ )
{
char descr [ 32 ] ;
cout << theTime[ i] .descr << " is " << theTime[ i] .hour << ':'
<< theTime[ i] .minute << ":" << theTime[ i] .second << endl;
}
}
IC8vIExhYiA4LCBXb3JraW5nIHdpdGggc3RydWN0cwovLyBQcm9ncmFtbWVyIDogTWFpYXIgS2hhdHRhYgovLyBFZGl0b3IocykgdXNlZCA6IENvZGUgQmxvY2tzIDEzLjEyCi8vIENvbXBpbGVyKHMpIHVzZWQgOiBDb2RlIEJsb2NrcyAxMy4xMgoKI2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIHN0ZDo6Y291dDsKdXNpbmcgc3RkOjplbmRsOwoKI2luY2x1ZGU8Y3N0ZGxpYj4KCi8vc3RydWN0IGRlZgpzdHJ1Y3QgdG9kCnsKaW50IGhvdXI7Ly8gdGhlIGhyICwgMC0yMwppbnQgbWludXRlOy8vIHRoZSBtaW4sIDAtNTkKaW50IHNlY29uZDsvL3RoZSBzZWMsIDAtNTkKY2hhciBkZXNjciBbMzJdOy8vdGhlIGRlc2NyaXB0aW9uIG9mIHRo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Q7ICZxdW90OyBFbCB2YWxvciBpbmljaWFsIGRlbCBjaW50YWRvciBlcyZxdW90OyAmbHQ7Jmx0OyBjb250YWRvciAmbHQ7Jmx0OyBlbmRsOwogICAgY29udGFkb3IrKzsKICAgIGNvdXQgJmx0OyZsdDsgJnF1b3Q7Y29udGFkb3IgZXMgYWhvcmEmcXVvdDsgJmx0OyZsdDsgY29udGFkb3IgJmx0OyZsdDsgZW5kbDsKICAgIGNvbnRhZG9yKys7CiAgICBjb3V0ICZsdDsmbHQ7ICZxdW90O2VsIGNvbnRhZG9yIGVzIGFob3JhJnF1b3Q7ICZsdDsmbHQ7IGNvbnRhZG9yICZsdDsmbHQ7IGVuZGw7CiAgICAKCiAgICAKICAgIHJldHVybiAwOwo=
int contador;
contador;
cout << " El valor inicial del cintador es" << contador << endl;
contador++;
cout << "contador es ahora" << contador << endl;
contador++;
cout << "el contador es ahora" << contador << endl;
return 0;