Archive

If I get a Boolean variable and put its second bit at 1, the variable is evaluated as true and false at the same time. Compile the following code with gcc6.3 with the -g option (gcc-v6.3.0 / linux / RHEL6.0-2016-x86_64 / bin / g ++ -g main.cpp -o mytest_d) and run the executable. File off. You get the following.How can one be true and false at the same time?

Read more

I want to define an effective whole floor function, i. e. A float or double conversion, which truncates to minus infinity. Can you imagine ideas to increase your performance in terms of speed, accuracy or range?

Read more

I need to implement many derived classes with different constant member data. Data processing should be in the base class, but I can not find an elegant way to access the derived data. The following code works, but I do not really like it. The code must be run in a small integrated environment. Therefore, using full or shifted libraries such as Boost is not an option. How can I remove the inheritance related code?

Read more

It's almost a factor two faster than the sum. And since the integrated sum should be about five times faster than manually adding a list (depending on the answer), it means that it is actually ten times faster! Does saving the fact of having to add only one counter for half the values, because the other half is ignored, is enough to take into account this difference?

Read more

If you use the same code, simply change the compiler (from a C compiler to a C ++ compiler) to change the amount of memory allocated. I do not know why and I would like to understand better. So far, the best answer I've received is "probably the I / O streams", which is not very descriptive and puzzles me on the aspect "you do not pay for what you do not use". Can you tell me where I am wrong?

Read more

I am from Python and I am currently learning C ++. I learned a C / C ++ function called memset and found the compile time errors. When I give t in single quotes to print it gives repetitive t’s?

Read more

I need an STL algorithm that uses a predicate and a collection and returns true if only one member of the collection satisfies the predicate, otherwise returns false.How could I do that with STL algorithms?

Read more

Why are dynamic mappings or exceptions not recommended in environments subject to high radiation, such as in space or in a nuclear power plant? As for the models, I do not understand why. Can you explain it to me?

Read more

I have tried making an app in swift UI but I wonder whether it will work in my iOS? I am having iOS  version 13 and if it works then does it work on version lower than this?

Read more

I was using std::string as a buffer and one of my friend noticed and said there are downsides of using std::string. If this is so then what is the problem in using std::string?

Read more