c++ tag

886 questions


1 answers
159 views
0
When is a virtual constructor used?

When is the virtual constructor used for C++?Virtual constructors seem to be a really useless feature, but I don't know when. Isn't superclass constructor called automatically when inherited? Why both...

2 years ago

2 answers
33 views
0
What are the disadvantages and overheads of a single-ton class?

Hello, I am a beginner developer who is developing games with C++ and DirectX.My question is that not only games but also various design patterns are applied when developing softwareAmong them, Single...

2 years ago

1 answers
93 views
0
There is something I don't understand about the code that contains the C++ iterator.(Difficulty level: Beginner)

Result of code: Question: Although I lack the concept of itator, I'm studying how to write while looking at the code to get a better sense of it.I don't understand the code below in the last for state...

2 years ago

1 answers
83 views
0
I would like to ask you how to determine if a specific element exists in std::set!

Please let me know if there is a way to check if there are any elements in the set without using for or auto

2 years ago

1 answers
26 views
0
How an object array works for initialization

#include <iostream>using namespace std;class Test{ private: int num; public: Test(int n) : num(n) { cout << Constructor : << n << endl; } Test(const Test& copy) : nu...

c++
2 years ago

1 answers
91 views
0
C++ Overriding, Polymorphism

Hello.The code I'm trying to do,class Shape { protected: int type; // POINT, CIRCLE, RECTANGLE, or TRIANGLE public: virtual double area()=0; virtual bool isContaining(const Point&)=0; enum {...


2 answers
139 views
0
std::is_same does not appear to be working properly.

Hello, everyone I have a question because there was a slight error in writing the c++ and stl codes.The code with the error first is as follows. An error occurs in the annotated area is processed.temp...

2 years ago

1 answers
28 views
0
c++ question. (__)

Hi, everyone. I got a lot of help from the last question and I have another question.If you look at the c++ code, there's a code that says #if and it's 1, 0, what's the role?And when is #endif used?#i...

c++
2 years ago

1 answers
69 views
0
C++ Copy Generators Call

#include <iostream>using namespace std;class SoSimple{private: int num;public: SoSimple(int n) : num(n) { cout << New Object : << this << endl; } SoSimple(const SoSimple&...

2 years ago

1 answers
26 views
0
Is it impossible to enter the private member variable directly as std::cin?

Is it impossible to enter the private member variable directly as std::cin?Also, why do the following problems occur?I'm curious Below are all the class header files.class Bank{private: int Account; ...

c++
2 years ago
« - 40 - »

© 2024 OneMinuteCode. All rights reserved.