I would like to display values formatted as currency, with thousands and cents separators.
I would like, for example, 56000/12 to have 4.666,67 . I can display 4,666.67 . Would there be any way to change . (dot) by...
I see several programmers doing this. Instead of accessing the member of a struct directly, it copies the value to a local variable to the function and uses this variable.
Is there performance gain in this? Does it matter if the struct...
With this code, the book tells me that this does not pop the stack, but why exactly does it not bang?
#include <stdio.h>
int main(){
int *p;
while(1){
p = new int;
}
}
Can I store more than one number in a variable? For example:
m= a&&b&&c&&d&&e
I need to indicate which is the largest and the smallest number that the user entered, wanted a way to do this without having to t...
I'm looking to build a question form in Qt. As there are several questions to be answered, it is necessary to allow the scrolling of the form, so I used a QScrollArea . The questions are all answered in a Likert scale, so I adjusted the...
I have a class similar to this and wanted the code it executed to be passed as a lambda expression.
class T {
public:
double execute();
};
For example:
T t;
int a = 0, b = 1;
t.execute([a,b]()->double{return (3*a + 5*b);});
What...
I noticed that some libraries use functions and static variables, such as static int sum(lua_State *state) .
This function belongs to a library that will be compiled into the Lua language.
But also libraries with dlsym calls...
I came across a C code that used a compilation directive in #ifdef and I do not quite understand what it's for. I found an explanation, but it was not clear. Here's an example policy and the explanation I looked for:
#ifdef <token>...
I have the following code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, cases = 1, a[3];
cin >> n;
while(cases != n + 1)
{
cin >> a[0] >> a[1] >> a[2];
sort(a, a + 2);
cout <...
I have already programmed in C ++ compiling with GCC and when I started using Visual Studio I noticed that it has support for C ++, however the implementation is geared towards the .Net platform.
Is there a difference between these two versio...