c++ tag

886 questions


1 answers
117 views
0
Is there a reason to distinguish between .h file and .cpp file?

Why does C++ use header files and .cpp files separately?

2 years ago

1 answers
127 views
0
Which one should I use, malloc or new?

In C++, there are many ways to dynamically allocate, right?Then when should I use malloc and when should I use new?malloc If you finished freeIf new is done, deleteI know I shouldn't mix the two.


1 answers
30 views
0
Best way to loop from the back on C/C++

We're going to approach the arrangement from the back to the frontI'd like to know a better way than the source code I madefor (int i = myArray.Length - 1; i >= 0; i--){ //take care of sth myArray[...

c c++
2 years ago

1 answers
97 views
0
Do I have to call a parent class extinction?

C++ class is overriding the virtual extinctionShould I call a parent class extinction within the extinction?MyChildClass::~MyChildClass(){ //Call Parent Class Destructor this->MyBaseClass::~MyBaseC...

2 years ago

1 answers
69 views
0
Eteration of C++ vector

How do I write vector literacy?Source code 1 is running normally, but source code 2 shows warning.C++ I just learned itIn the past, unsigned was something that was told to be very carefulunsigned It's...

2 years ago

1 answers
126 views
0
&&& What is doing?

If you compile the code below into the gcc -Wall /-Waddress option,warning: the address of ‘i’ will always evaluate as ‘true’ [-Waddress]It appears.I don't know why it's coming up. I don't know what i...


1 answers
67 views
0
=! What is the operator?

!I'm asking =! not =.We didn't even assign a value in the code belowWhy is false coming out?int main(){ int a; int b = 3; return if(a =!b) { //false cout << a =! b is true! << endl; } els...

2 years ago

1 answers
116 views
0
How do I take out the sign?

The factor will enter float and Is there a standard library function that does this?

2 years ago

1 answers
119 views
0
How do I change int to QString?

Is there a function that takes int as a factor and returns QString?I'm looking for a function like intToQSTring() in the code below!int i = 42;QString s = intToQSTring(i)

2 years ago

1 answers
80 views
0
int main(){([](){}()));} Why does it run normally?

I'm asking you a question because I saw such a strange code.I don't know why ([](){})()); is compiled normally in the source code belowI'm not a function pointer, I'm not an operator.But if you run it...

« - 36 - »

© 2024 OneMinuteCode. All rights reserved.