c++ tag

886 questions


1 answers
73 views
0
To call a parent class constructor

How does C++ call the constructor of a parent class (even a parent's parent) in a child class?In Java, we could have called the parent class constructor on the first lineWhat should I do with C++


1 answers
130 views
0
Which is faster, "for(;)" or "while(TRUE)?

[Which is faster, (1) or (2)?I thought of this while looking at for (;;) { //Something to be done repeatedly}I've seen a lot of codes like this, but I haven't seen them write in while(true).I think wh...


1 answers
29 views
0
There are too many processes in the forks

When you run the following source code:As I intended, there should be 6 molesThere are 8 pictures. Why is that?#include <stdio.h>#include <sys/types.h>#include <unistd.h>int main(voi...

2 years ago

1 answers
143 views
0
I want to sleep in milliseconds

I know that the sleep(x) function of C++ POSIX is sleep in secondsI want to do sleep in milliseconds, but is there a function like this?

2 years ago

1 answers
128 views
0
What does (int argc, char *argv[]) do?

I usuallyint main()We share a roomIf you're working on C++ IDE,Make the main function int main(int argc, char *argv[]) automatically.The factor is when you call a function, but the main function is ex...


1 answers
27 views
0
unsigned int and size_t

The string-related function parameters in the C/C++ STL are:You used size_t instead of int/ unsigned intWhy is that? Is there anything good about it?

2 years ago

1 answers
26 views
0
Object and object pointer destructor calling scheme

Assume ClassName is a TestTest fTest;Test *sTest;Does the compiler automatically call destructors only for objects assigned to the stack?So the fTest calls the extinction on its own by the compiler?In...

c++
2 years ago

1 answers
31 views
0
The destructor was not called when the program was terminated using the exit() function in the function inside the object. Is there a way to terminate the program while calling the extinction?

Hello, I am a student who is learning programming at the university.This is an error that occurred while working on the team project last time, but I'm asking you a question because I think the projec...

c++
2 years ago

1 answers
58 views
0
What's the difference between declaring and defining?

What's the difference between declaring and defining?Is it just the difference between having {} and not having it?

2 years ago

1 answers
84 views
0
How do I initialize all C++ structure member variables to zero?

Is there an easier way to initialize all object member variables to zero?Now struct Snapshot{ double x; int y ;};int main(){ struct Snapshot mystruct; mystruct.x = 0; mystruct.y = 0;}They're resettin...

« - 72 - »

© 2024 OneMinuteCode. All rights reserved.