Questions tagged as 'c++'

3
answers

Compiler reports error when I try to zero vector

The compilers accuse error when I try to zero a vector with the command vetor[10] = {0}; And it only accuses error in this line because I also used it in the int vetor[10] = {0} attribution and there does not acknowledge error....
asked by 24.03.2015 / 21:15
3
answers

Is it safe to create object pointer on the stack indirectly?

My class has a method that returns a pointer to itself, and at some point I use the following: void classequalquer::metodo() { ClasseA * ponteiro = ClasseA().getThis(); //usa o ponteiro nesse método sem usar delete } //Para referência...
asked by 07.03.2017 / 02:31
1
answer

What are the advantages of using directives and macros?

Do policies and macros influence program performance?     
asked by 25.02.2016 / 22:30
3
answers

Unsigned int does not work?

Next, my program keeps compiling even after I have assigned a negative value to an unsigned variable, why does this happen? Using the IDE Code :: Blocks 13.12 unsigned int numero1 = -1;     
asked by 09.05.2015 / 20:05
1
answer

ERROR: This is application failed to start because it could not find or load the Qt platform plugin "windows"

I'm having an error while running a program that was created with Qt, it generates the error of the photo! This error is generated when I run the exe, all the dlls indicated in dependency walker are in the exe folder. Would anyone help me?...
asked by 04.03.2015 / 19:05
2
answers

Count elements in a range of values

Is there a more concise way of counting all the elements of a vector (here in the example between 10 and 20) than the one presented? vector<int> v={1,2,3,45,24,10,20,-90,100,18,17,15,87}; int n; for (int i=0;i<v.size();i++){...
asked by 16.12.2015 / 10:54
3
answers

How to check which technologies the CPU supports at runtime?

I'm writing a PC program that has optimized function calls for SSE2 , SSE3 and maybe SSE4 . However, I can not guarantee that the PC that will run the program supports these technologies and would like to check the support so...
asked by 17.03.2014 / 01:07
3
answers

Block window magnification

How can I block the increase of the window QDialog and QWidget ? For example, in the Skype login window you can not enlarge the window.     
asked by 18.03.2014 / 13:17
1
answer

In C ++ where the functions of objects are in memory?

In C ++ when an object is declared, the class variables are stored in the stack or heap depending on how the object was created. With the sizeof() operator it is possible to test and realize that the object size of a class is allocate...
asked by 04.05.2016 / 22:58
1
answer

How to avoid buffer overflow in C / C ++

The program below allows the occurrence of memory overflow, because it is possible to override the variable zero by placing a "large" value in the variable buffer . How to make a secure program by avoiding buffer overflow ? #include <...
asked by 05.08.2016 / 04:04