Skip to main content
Advice
0 votes
3 replies
56 views

I need help with my homework. I'm not sure what I'm doing wrong. Here is what the homework prompt is: Write a complete C++ program that allows the user to input and sort two values of a selected data ...
Lizzie Reyes's user avatar
-9 votes
0 answers
66 views

I believe this picture will indicate the problem I'm experiencing: Only when the string is not found then the loop should perform. And clearly this is not the case here. So how to ensure that the ...
Igor's user avatar
  • 6,570
Advice
0 votes
2 replies
120 views

Why can't you just do this? int index = 0; std::string example; std::cin >> example; std::vector<std::string> list; list.push_back(example[index]); I'm a complete beginner in c++ and I ...
Filipos's user avatar
-8 votes
0 answers
101 views

I'm supposed to be taking over a server application which is sending documents to a printer. It does the following: if (OpenPrinter((LPTSTR)printer, &hPrinter, nullptr)) { wchar_t ...
Dominique's user avatar
  • 17.7k
4 votes
2 answers
102 views

A similar quesion Passing JSON object by value or reference doesn't have an answer but in comments Niels Lohmann himself states: I would try not to pass by value. The internals are vectors/maps/...
Ivan's user avatar
  • 633
1 vote
0 answers
64 views

I want to open a web app installed through Microsoft Edge using ShellExecute. I want to pass a path and some dynamic query parameters to the web app but this doesn't seem to work. For example, I ...
katkak's user avatar
  • 356
1 vote
0 answers
94 views

I'm trying to create a pointer like type wrapper for CUDA device pointers, but ran into a problem I can't reproduce with other compilers in regular MSVC or GCC. Basically, depending on the order I ...
Krupip's user avatar
  • 5,520
9 votes
2 answers
717 views

If I have a function template returning const-qualified type (with a trivial body for example): const auto f(auto) { return 1; } and I want to get a pointer on a particular instance of the function ...
Fedor's user avatar
  • 25.6k
1 vote
3 answers
197 views

I want an abstract class range initializer that can be used in a range-based for loop. Is such a thing even possible? Currently I only see how to do that with non-abstract classes. Class TestRange ...
Existn't's user avatar
  • 121
-1 votes
0 answers
100 views

I have a C++ application that is trying to send something to a printer in order for it to be written. That application is working fine with a lot of customers, so the code is ok. While checking the ...
Dominique's user avatar
  • 17.7k
Best practices
0 votes
8 replies
131 views

I was recently solving the basic palindrome number check question on leetcode and wasn't able to find an optimal solution for space complexity. It wasn't space optimized. Can anybody analyse this code ...
Naitik Bansal's user avatar
0 votes
1 answer
116 views

I have the following in a header file: template <typename A, typename B> pair<B, A> flip_pair(const pair<A, B> &); template <typename A, typename B, typename Cmp = less<...
khteh's user avatar
  • 4,356
11 votes
2 answers
649 views

I'm trying to create a pointer like type wrapper for CUDA device pointers, but ran into a problem trying to define T& operator[]. By default, the compiler complains that I'm attempting to "...
Krupip's user avatar
  • 5,520
Advice
0 votes
12 replies
87 views

I have the following directory structure for a C++ project: external eigen-5.0.1 Eigen source <source files> When compiling, I add both external/eigen-5.0.1 and source to the -...
josh_eime's user avatar
  • 308
-4 votes
0 answers
58 views

Cannot find directory 'cserialport' in search paths: C:\Program Files\JetBrains\CLion 2025.3.3\bin\mingw\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++ C:\Program Files\JetBrains\CLion 2025.3.3\bin\...
Bl4zej's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
54323