Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- ////////////////////////////////////////
- struct T
- {
- int nSec;
- int nMin;
- void get(int n);
- void monitor();
- };
- void monitor(T *p);
- /////////////////////////////////////////////////////////////////////
- int main() //
- {
- T t_1;
- t_1.get(712);
- t_1.monitor();
- }
- //////////////////////////////////////////////////////////////////////
- void T::monitor()
- {
- printf("Minuts = %d\n", nMin);
- printf("Seconds = %d\n", nSec);
- }
- /*
- //////////////////////////////////////////////////////////////////////
- void monitor(T *p)
- {
- printf("Minuts = %d\n", p->nMin);
- printf("Seconds = %d\n", (*p).nSec);
- }
- */
- ////////////////////////////////////////////
- void T::get(int n)
- {
- nMin = n / 60;
- nSec = n % 60;
- }
- /*
- #include <stdio.h>
- ////////////////////////////////////////
- struct T
- {
- float fBallance;
- int nNumber;
- static int nCounter;
- T()
- {
- nNumber = nCounter;
- nCounter ++;
- }
- };
- int T::nCounter = 0;
- /////////////////////////////////////////////////////////////////////
- int main() //
- {
- T t[9];
- for(int i = 0; i < 9; i++)
- {
- printf("t[%d].nNumber = %d\n", i, t[i].nNumber);
- }
- }
- */
- /*
- #include <stdio.h>
- void foo()
- {
- static int n = 0;
- n++;
- printf("%d\n", n);
- }
- /////////////////////////////////////////////
- int main()
- {
- for(int i = 0; i < 10; i++) foo();
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement