int var1 = obj->count;//count - типа int delete obj; int var2 =var1;//можно ли инициализировать? Function(var1);//или передавать в функцию? 

Is it correct to do so? I do this several thousand times in my program. Will something bad happen over time?

  • one
    We can say so: the value from obj-> count was copied to var1 - Valera Kvip
  • @ValeraKvip, that is all right? - Arthur Klochko

1 answer 1

No, it will not happen. You are copying a variable. On the stack, the variable var1 is created, which is initialized with the value obj->count .