V
V
voproser456542022-04-01 21:40:18
C++ / C#
voproser45654, 2022-04-01 21:40:18

How to "forget" a variable in c/c++?

How to "forget" a variable in c/c++? Let's say you used a variable, and you don't need it anywhere else, the question is: how to delete it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2022-04-01
@voproser45654

Variables cease to exist after the end of the block in which they are declared. Accordingly, use small functions, declare variables as close to where they are used as possible, and the compiler will take care of everything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question