c++ tag

886 questions


2 answers
131 views
0
Why do you take virtual inheritance?

virtual base class, virtual Why is inheritance used?I want to know what it means.class Foo{public: void DoSomething() { /* ... */ }};class Bar : public virtual Foo{public: void DoSpecific() { /* ... *...

2 years ago

1 answers
133 views
0
To assign a string that spans multiple lines at once

I'm just going to copy and paste the sentence from the file.There is an error in my code.And the color changes in the middle What should I do?using namespace std;int main(){ const char* msg = hello m...

2 years ago

1 answers
38 views
0
What is #ifndef, #define in the header file?

I saw the source codeWhat are you doing?#ifndef HEADERFILE_H#define HEADERFILE_H...#endif

2 years ago

1 answers
155 views
0
Why does 0.1f become 10 times slower if you change it to zero

When I ran it on Visual Studio 2010 SP1,Source Code 1 operates about 10 times faster than Source Code 2.There are only two lines that change. I don't think there's much differenceWhy is the performanc...


1 answers
58 views
0
When is a virtual extinction used?

I understand that I have virtual attached to the constructor or other function,I don't know why virtual is used for extinction.When an object disappears, it automatically calls for an inherited class,...


1 answers
123 views
0
The difference between "structure" and "typedef structure"

What's the difference between these two in C++?Most of them use the second methodWhy is that?

2 years ago

1 answers
32 views
0
When defining a class.h?hpp? Which one?

When I was defining the class, I did it at .hIn boost libaray, everyone defined a class in .hpp, right?Maybe it's because I've never used it like that, but it looked weirdIs there any advantage of usi...

c++
2 years ago

2 answers
128 views
0
What does the explicit keyword in C++ do?

I'm going around the internetgoI saw the C++ code below What does this explicit do for you?class String {public: explicit String (int n); //allocate n bytes String(const char *p); // initialize sobjec...


1 answers
81 views
0
Where can I see the C/C++ standard?

Looking at other answers, I saw a lot of things like standard or standardWhere can I see standard documents?I wish I could see it on the internet!I searched Cstandard on Google, and only the community...

2 years ago

1 answers
110 views
0
Create a two-dimensional array with new

How do I make a two-dimensional array with new?When it's a one-dimensional arrangement,int* ary = new int[Size]I wrote it like thisin a two-dimensional arrayint** arr = new int[sizeX][sizeY];I can't c...

2 years ago
« - 35 - »

© 2024 OneMinuteCode. All rights reserved.