@programina
2049 / 604 / 37
Регистрация: 23.10.2011
Сообщений: 4,468
|
11.02.2014, 00:20
|
|
C++ #include <stdio.h>
struct My
{
int x;
My()
{
this->x = 0;
}
My(int _x)
{
this->x = _x;
}
};
void foo(My &my)
{
printf("Введите число: ");
scanf("%d", &my.x);
}
int main()
{
My my1;
printf("%d\n", my1.x);
My my2(3);
printf("%d\n", my2.x);
My my3 = (My)4;
printf("%d\n", my3.x);
My my4;
foo(my4);
printf("%d\n", my4.x);
}
1
|