Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <locale.h> // çäåñü "æèâ¸ò" setlocale(LC_ALL, "rus");
- #include <stdlib.h>
- #include <string.h>
- //////////////////////////////////////////////////////////////
- struct T
- {
- char sz[15];
- float n;
- /////////////////////////
- T()
- {
- printf("Hello\n");
- strcpy(sz, "empty");
- n = 0.07;
- }
- T(const T &r)
- {
- printf("SONY\n");
- }
- /////////////////////////
- void print();
- };
- //////////////////////////////////////////////////////////////
- void T:: print()
- {
- printf("sz = %s, n = %7.2f\n", sz, n);
- }
- void foo(struct T);
- //////////////////////////////////////////////////////////////
- int main()
- {
- T t_1, t_2, t_3;
- T t_77 = t_1;
- t_3.n = 299.99;
- t_3.print();
- t_2.print();
- foo(t_1);
- }
- //////////////////////////////////////////////////////////////
- void foo(struct T t_x)
- {
- printf("t_x.sz = %s, t_x.n = %7.2f\n", t_x.sz, t_x.n);
- }
Advertisement
Add Comment
Please, Sign In to add comment