M
M
Maxim Solovyov2020-10-11 15:34:36
C++ / C#
Maxim Solovyov, 2020-10-11 15:34:36

How to declare variables in winapi c++?

I learned to program in c ++ in the console, and initialization of variables did not cause problems there, since it was possible to declare them before a function or a cycle and work with them further. Switching to winapi, I ran into the problem of declaring and working with a variable, for example, I declare , I will work with it, at the end the window is drawn and the new code declares . Maybe someone can throw off the simplest example of a program with one button, which increases the value of a variable by 1 and displays it on the screen, I'll try to understand it myself. int x = 0;int x = 0;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2020-10-11
@Solova23

There is no difference in vinapi or in the console - for declaring variables - no. Bring YOUR code - most likely the point is the PLACE of the variable declaration

M
Maxim Solovyov, 2020-10-11
@Solova23

that's the question where and how to declare so that the button adds +1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question