𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi guys, is it possible to take an input from the user, but make it Macro?
For istance, I have this macro:
#define MAP_SIZE 10
But, honestly, I would like my user to be able to choose the size of the map, and, at the same time, I would like it to be macro, so I can access it whenever I need it.
My professor never explained something quite like this, so perhaps it may be a stupid question
Anonymous
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Mouse]
"SmoothMouseXCurve"=hex:\
00,00,00,00,00,00,00,00,\
70,3D,0A,00,00,00,00,00,\
E0,7A,14,00,00,00,00,00,\
50,B8,1E,00,00,00,00,00,\
C0,F5,28,00,00,00,00,00
"SmoothMouseYCurve"=hex:\
00,00,00,00,00,00,00,00,\
00,00,38,00,00,00,00,00,\
00,00,70,00,00,00,00,00,\
00,00,A8,00,00,00,00,00,\
00,00,E0,00,00,00,00,00
[HKEY_CURRENT_USER\Control Panel\Mouse]
"MouseSpeed"=hex:2
"MouseThreshold1"=hex:2
"MouseThreshold2"=hex:12
"MouseSensitivity"="10"
"ActiveWindowTracking"=dword:00000000
"DoubleClickSpeed"="200"
"DoubleClickHeight"="4"
"DoubleClickWidth"="4"
"MouseHoverTime"="100"
"MouseHoverHeight"="4"
"MouseHoverWidth"="4"
"MouseTrails"="0"
"SnapToDefaultButton"="0"
"SwapMouseButtons"="0"
"ExtendedSounds"="No"
"Beep"="No"
Pavel
Is such implementation of serializing int safe? (if we skip endianness issues)
template<typename Int>
void WriteInt(std::vector<std::byte>& inOutByteStream, Int integer)
static_assert(sizeof(std::array<std::byte, sizeof(Int)>) == sizeof(Int));
auto& byteRepresentation = std::bit_cast<std::array<std::byte, sizeof(Int)>&>(integer);
inOutByteStream.insert(
inOutByteStream.end(),
std::begin(byteRepresentation),
std::end(byteRepresentation)
);
}
I'm a bit concerned about casting to std::array, which is struct with one member which is C-style array, it feels safe in the current implementation, but I'm not sure if I can rely on this implementation detail.