Questions tagged [c++]
C++ is a general-purpose programming language. Use this tag for questions about/utilizing C++. Do not also tag questions with [c] unless you have a good reason. C and C++ are different languages. Use a versioned tag such as [c++11], [c++20] etc. for questions specific to a standard revision.
809,575
questions
0
votes
0
answers
24
views
C++ Rectangle 2D Array with numbers beside the rectangle
I've been trying to make a 2D array of rectangle, and i want the number of index x to printed beside the rectangle and index y to be printed below the rectangle..
Here is my code..
int height, width;
...
0
votes
1
answer
42
views
What is error: expected unqualified-id before ‘(’ token?
I clone this open source project https://github.com/balfieri/cordic. I encountered issue below after following README to run $ g++ -std=c++17 -o test_basic test_basic.cpp
$ g++ -std=c++17 -o ...
0
votes
2
answers
43
views
How to change the value of char in C++
Hi I'm completely new to C++.
I have an assignment that is asking us to "Change the value to 97".
The first part of the task is to make a character and give it the value 'a'. Then print ...
-1
votes
0
answers
28
views
Access Violation in destroying boost io_context c++
I have a program that errors on the destruction of the io_context module. io_context is stopped before the destructor of Mainframe occurs. io_context is also owned by the Mainframe class. What is the ...
0
votes
0
answers
33
views
How can I have each `using` of a base struct be a different type?
I have a tuple of elements that I want to access using std::get with the type name:
template<typename... Params>
struct SomeType
{
std::tuple<Params...> params;
};
using TypeOne = ...
-1
votes
0
answers
34
views
Is there a way to make my compiler warn if my method-call explicitly calls up to a non-direct-parent superclass? [duplicate]
Background: After some careless refactoring, the following dumb mistake crept into my codebase, resulting in a somewhat-hard-to-track-down runtime misbehavior:
class Grandparent
{
public:
void Foo(...
0
votes
0
answers
22
views
/Fo Command Does Not Output Object When Compiling C++ std Module
Context
I am using Visual Studio 2022 v17.10.4
So I am attempting to make a script to make compiling C++ programs easier for me using the Visual Studio 2022 compiler. I found a textbook about ...
1
vote
0
answers
27
views
Can WindowsGraphicsCapture APIs capture child windows?
I need to capture the image of a specific window and save it as an array. I initially used BitBlt, which worked well except for windows with hardware acceleration (it seems to work for DirectX-...
0
votes
0
answers
49
views
default member initializer for needed within definition of enclosing class outside of member functions [duplicate]
The following code
class A {
public:
struct B {
unsigned int b0 = 10;
unsigned int b1 = 11;
};
A::B empty {};
const A::B emptyConst {};
static constexpr A::B ...
-1
votes
1
answer
36
views
Template parameters for c++ multidimentional array [duplicate]
Can someone explain how the following base template and specialization is instantiated to produce the correct result? I'm particularly unclear on how the <U[N]> template parameter is interpreted....
0
votes
0
answers
18
views
g++ print source-mapped file path in error
I have a C++ file that I'm compiling with g++ with the -ffile-prefix-map option. Is there a way to tell g++ to print the remapped file name when there are build errors? That way, clickable file names ...
-4
votes
0
answers
29
views
VSCode C++ ld: symbol(s) not found for architecture arm64 problem in Mac [closed]
I have issue about the vscode with c++ when i run the single file like hello world its working good but gives this error when the header file and other files are included in the include event
When ı ...
-1
votes
1
answer
54
views
How to initialize a member by expanding tuple inside an member initializer list? [duplicate]
I am expanding an std::tuple in order to initialize a ranges::concat_view member as follows:
...
Bar(const std::tuple<Args...>& tpl, std::index_sequence<Idx,...>) :data{(std::get<...
-3
votes
0
answers
38
views
Where can I see the system tray icon on MacOS? [closed]
I have created using system tray icon class in Qt C++ SDK.
But I couldn't see on the MacOS System and haven't seen any system tray icon on MacOS until now.
I would like to know if anyone can help me ...
0
votes
1
answer
23
views
How To use QSqlQuery::bindValue
I have this snippet :
int id = m_AddItemCandidate->getId();
QString s = "INSERT INTO studied_substantives (subst_id, no_singular, no_plural, meaning) ";
s = s + "VALUES(:id,...