You can see commit history by clicking the commits link:
You copy the SHA of the commit you want to revert to, open a terminal, go to source folder and type
git reset --hard <SHA>
C++ and MATLAB Simulink tips for HWIL simulation software engineers
You can see commit history by clicking the commits link:
git reset --hard <SHA>
Dynamically creating array of object on the heap:
MyClass** objects;
arrSize = 100;
objects = new MyClass*[arrSize]; //Note the '*' before arrSize
for (size_t i = 0; i < arrSize; i++) {
objects[i] = new MyClass();
}
Freeing up heap memory allocated to object array:
for (size_t i = 0; i < arrSize; i++) {
delete objects[i];
}
delete[] objects;
Tip: You can use Visual Studio's Memory Usage diagnostic tool to check heap memory changes which gives clues about memory leaks. To get the function names where memory is allocated but then never released, use valgrind on WSL (Linux) as follows:
valgrind --tool=memcheck --leak-check=yes ./<app name>
You can use Windows 10 and Visual Studio 2022 to generate, debug and analyze Linux binaries:
The following C++ code demonstrates how to safely use an array that is written to by one thread and read from in another thread:
You could define a custom class that derives from JFormattedTextField and use KeyListener to get the raw text that the user is typing: