We are working with financial calculations. I found this post about storing money values as decimals: decimal vs double! - Which one should I use and when?
I've recently seen the following code:Basically I try to dig into new c# 8 features. One of them is NullableReferenceTypes. Actually there're a lot of articles and information about it already. E.g. this article is quite good. But I din't find any information about this new statement null! Can someone...
I want to know why strcmp() returns different values if used more than once in the same function. Below is the program. The first case I am aware of why it prints -6. But in the second case, why does it print -1?
Suppose I have a program like this:Where the takeaway is that I'm trying pass the main() function's char** argument to another function or class. (I understand there are better ways to achieve what the above program does, my question is about passing char** arguments as read-only).
I have a class that holds some statically-sized containers:where a Container class might look like:Now I want to specialize the bar method based on the size of the container. I do not understand how to do that.
According to this question std::array is allocated on the stack. However when using it together with Valgrind it shows me a heap allocation, even for elements which are allocated on the stack. Is this a false positive or real?
This question already has an answer here:What does gcd = x < y ? x : y mean? Does it mean that gcd is equal to the smaller one between x and y?
I'm reading the C Programming Language (chapter 5), and I'm confused by this example:Why is this function call in here like that? Is this just some tricky example and invalid code?
In C++ functions, is it a good practice to replace return with throw? For example, I have the following code
I am writing a program about job interview. Everything is working properly, except one thing. When I use an outside method TotalLines (where I have seperate StreamReader), it is working properly, but when I am calculating a number of totalLines in the program, I am receiving one question mark on...