Questions tagged as 'c++'

1
answer

Data Race or Deadlock? [closed]

I'm developing a project and the code is too big. To try to decrease the time spent in a calculation I decided to call this function in parallel. This worked for some test cases, but for another case the program always hangs, and in others di...
asked by 25.08.2014 / 16:11
0
answers

How to use Geolocation API with QtWebkit?

You can use Geolocation API with Desktop applications using QWebView ?    I've tried Qt WebKit and HTML5 geolocation , but it does not work.    I tried it's the qt5 position api support for desktop app (like mac or windows) ,...
asked by 22.03.2015 / 19:33
3
answers

How do I get data from an object and do a math operation with another object in C ++?

I have to calculate the distance between two points in C ++ (Object Oriented) Here is the code I have: Ponto p1(2,-3); Ponto p2(4,5); class Ponto { public: Ponto(int x1, int y1) : x(x1), y(y1) {} CalculaDist (); private: int...
asked by 29.09.2017 / 20:42
2
answers

How do I force "while"?

This program allows you to calculate the table of up to 10 up to a given number x. But in the cycle of while after the first iteration it does not enter and jumps to the end. For example, if I enter 2 my output is: Introduza o numero...
asked by 17.08.2015 / 19:30
1
answer

"undefined reference" in the constructor of a C ++ function

I am creating a class of name VS1838B that is composed of other instances. This is the class header: #ifndef INFRAREDRECEIVERVS1838B_H #define INFRAREDRECEIVERVS1838B_H #include "Arduino.h" #include "IRremote.h" #include "IRremoteInt.h" c...
asked by 28.07.2015 / 05:37
1
answer

Making Calculation of IMC I'm not only getting the result 80

#include <stdio.h> #include <math.h> int main() { float peso,altura,imc; imc=0; printf("digite seu peso ?"); scanf("%f",&peso); printf("digite sua altura? "); scanf("%f",&altura); imc= (peso...
asked by 16.09.2018 / 04:06
1
answer

Is it recommended to use IDE to program in C ++? [closed]

When I was learning C I programmed using a text editor and a compiler, but as C ++ is turned to POO maybe an IDE would help although I did not much favor IDE's. I would like to "hear" your opinion because I am really undecided. Thank you for you...
asked by 10.06.2016 / 18:32
2
answers

Calculate memory address by pointer arithmetic

Suppose the elements of the v vector are of type int and each int occupies 8 bytes on your computer. If the address of v[0] is 55000, what is the value of the expression v + 3 ?     
asked by 14.04.2018 / 22:07
2
answers

How do I define operator = for a struct in c ++?

I have the following structure: struct PATH { vector<ARCO_TEMPO> rota; set<int> rotaAux; float COST; int nArcosVoyage; vector<bool> VisitedNodes; vector<vector<bool>> VisitedVertices; int head_no;...
asked by 03.04.2018 / 22:29
1
answer

How to check if the function would generate an exit in C ++

I have .lib with some functions. I define that when the calculation of some function generates values outside the allowed range it gives a exit() . Now my code in C ++ that uses this lib needs to compute some of these functions...
asked by 29.03.2018 / 06:27