Questions tagged as 'c++'

1
answer

I get an error in the c ++ class constructor

#include <windows.h> #include <stdio.h> namespace textTDengine{ typedef const char* spr; enum direction{up,down,left,right}; struct vector2{ float x; float y; vector2(float x,float y){ this->x = x; thi...
asked by 30.05.2017 / 02:56
1
answer

Create a dynamic matrix based on data from other C ++ functions

Good evening. I'm thinking about the vector library and one of the utilities that I see is great is that you can create a vector that is a variable Example: int main() { int a=5; vector<double> vec(a,0); } That would be equivalent...
asked by 31.05.2017 / 22:57
2
answers

Entering and printing a vector's data

I have this code #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <cstring> using namespace std; int i, Num1; int main() {int Columna; int ValorIngresado; int FilaA [9],a; for (a=0;a<9;a++...
asked by 29.05.2017 / 22:26
1
answer

Convert string to int

In this program I have to enter 2 whole numbers a and b and the program should display on the screen the numbers harshad (numbers that are divisible by the sum of their numbers) between a and b. A and b must be positive, and b greater than a....
asked by 20.05.2017 / 17:51
1
answer

join Qlabel in a Qdialog

I have a question about how to connect a QLabel in a QDialog . The idea is to be able to open a QDialog before running the program. I leave part of the code: QDialog jjj; QLabel *logojjj; logojjj->setPixmap(QPi...
asked by 25.07.2017 / 20:52
2
answers

Round with 2 decimals in C ++

In the HUD of my game I show the time ( tipo: float ), but I need it to be mm:ss , that is, 2 decimal places after the comma. float timeReal = 12.342334; float timeRedondeado = ... How can I save it with 2 decimals?     
asked by 15.05.2017 / 16:31
1
answer

I try to click on the header to order that column of elements, but I can not detect the signal. Does anyone know how to fix it?

connect(tableView->horizontalHeader(), SIGNAL(clicked(int)), this, SLOT(ordenar(int))); in the header declared private slots: void ordenar(int logicalIndex); void MainWindow::ordenar(int logicalIndex ) { QString id;...
asked by 12.05.2017 / 08:58
2
answers

Error doing delete C ++

I have something very simple in C ++ (trying to remember it) a library that I call element.h: using namespace std; typedef struct elemento{ int clave; string nombre; string apellido; struct elemento *prox; }Element...
asked by 16.05.2017 / 18:24
1
answer

Help with c ++ program? [closed]

It's a problem with the pointers. Here I have a program that gives "high" soccer players, asks the name of the coach, and then asks you to fill some fields about the information of your players. The problem is that the program stops working w...
asked by 16.05.2017 / 03:38
1
answer

Problems coding a Taylor series (natural logarithm)

I have a small problem with the Taylor series. To be exact with the natural logarithm. For what I realized, is because the divisor grows brutally and the word script does not give me more, I've tried with data types long long but even s...
asked by 21.05.2017 / 20:25