4 questions from the last 1 days
0
votes
2
answers
62
views
How to pass 2D array to function that the size is declared by user input [duplicate]
So the question given to me is to make a C++ program where the user inputs the size (declared by n) of a matrix N x N, and then there's a function for the user to fill the matrix called inputMatrix
#...
0
votes
0
answers
40
views
OpenCV producing completely black mask from image
I'm attempting to narrow a screenshot of an app to a specific section of the UI for later processing by Tesseract; in particular, the X Battle ratings located in the lower half of the image.
I did a ...
-1
votes
0
answers
59
views
Why does Clangd warn when using C++20 designated initializers with uniform initialization syntax?
According to modern C++ guidelines, we should prefer uniform initialization everywhere, for example:
int x{0};
However, when I try to combine uniform initialization with C++20’s designated ...
3
votes
2
answers
102
views
How to cause a linker error when an externally-defined macro is inconsistent across translation units?
I'm writing a header-only library which defines class X in header x.hpp. The implementation of X is different for different standard versions:
#if __cplusplus < 201703
class X {
int a; ...