Maybe your ObjectItem struct is wrong
I don't know if the structure is correct. I can't figure out where the values in char PosX come from; charPosY;
I did not find a single piece of code that would write values to these variables.
https://prnt.sc/26gxuca
Writing to variables goes in main.exe
Запись в переменные идет в самом main.exe
https://prnt.sc/26h135z
Added these lines from other sources now everything works.
Could you explain a little to me how main writes values to these variables?.
I want to understand this and understand how it works.
Не могли бы вы мне немого объяснить как main записывает значения в эти переменные?.
Я хочу в этом разобраться и понимать как это работает.
Certainly! `#pragma pack` is a preprocessor directive used in the C and C++ programming languages to control the alignment of structures or other data types in memory. The `#pragma pack` directive allows programmers to specify or modify how the elements of structures or variables are aligned in the computer's memory.
The `#pragma pack` directive is followed by an integer argument that specifies the desired alignment. This argument indicates the number of bytes with which to align the elements of structures. Typically, the value is specified as a power of 2 (e.g., 1, 2, 4, 8), but it can vary depending on the compiler and platform.
For example, if you want to align the elements of a structure to 4 bytes in memory, you can use the `#pragma pack(4)` directive before the structure definition. This will cause all elements in the structure to be aligned on 4-byte boundaries instead of the default alignment.
It's important to note that using `#pragma pack` can lead to more efficient memory usage in certain cases but can impact performance because accessing unaligned data may be slower on some hardware architectures. Therefore, it's essential to use this directive carefully and consider the specific requirements of your platform and program when deciding to modify the default alignment.
Explained by Chat GPT.