Questions tagged as 'c++'

2
answers

Exceptions c ++ POO

I must create a program with the triangle class and then create a class with the following exceptions: An error message is issued if one of the sides has a value of zero. An error message is issued (at its own decision) if one of the sides...
asked by 07.11.2018 / 15:33
2
answers

Convert a char array to uint8_t

I have the following array of characters: char caracteres[10] = {'1', '2'}; And the next uint8_t (its size is 1 byte): uint8_t resolucion; What I want is to store the 12 (as a number) within the variable resolucion . I hav...
asked by 23.05.2018 / 12:21
4
answers

Print decimals in c ++

The question is basic. I have the following code: #include <iostream> #include <iomanip> int main() { double resp = 0.8912637126836812; resp = 5/2; std::cout << std::fixed << std::setprecision(4) <<...
asked by 13.04.2018 / 06:29
2
answers

Error: 'name' was not declared in tis scope

I have doubts with this task to be programmed in php but in c ++ I am just learning, The program marks me an error in the function    xalan (x, i)    15 24 C: \ Users \ admin \ Documents \ task8 \ 9 \ main.cpp [Error] 'xalan' was not declared...
asked by 04.12.2018 / 02:49
2
answers

Segmentation fault (core dumped)

I'm working with makefiles, when compiling the following code, the random option works perfectly, but in the option to enter the matrix using the keyboard, this Segmentation fault (core dumped) comes out, could you tell me why this is wro...
asked by 25.05.2016 / 16:17
4
answers

Sort two vectors with sort ()

In an exercise of Programming Principles and Practice Using C ++ they ask to order two vectors; one of names and another of ages, and in the end they must coincide. For example: I have 2 vectors: vector<string> nombres; vector<do...
asked by 29.12.2016 / 09:36
3
answers

Error creating thread in c ++

I'm trying to create a thread in c ++, but my code does not compile. void Programa::ordenUnoParelelismo() { std::cout << "<<-- ALGORITMO UNO PARALELISMO -->>" << std::endl; int hilos = intInput("Ingrese numero d...
asked by 08.12.2017 / 13:55
3
answers

Convert a float or an integer to string in c ++

I wanted to know a simple way to convert a variable float or int in data type string in C++ . Because look in several places and talk about using sprintf , from the library stdio.h but it does not work w...
asked by 21.04.2018 / 16:36
3
answers

How to show the number of employees by sex?

I have the following code which shows me the data of N number of employees admitted My question is this: How do I show the number of employees by sex? int main(void){ /*Declara las variables para los ciclo for*/ int i = 0, n = 0...
asked by 29.03.2018 / 17:16
4
answers

Alternative to system ("PAUSE") c ++

Hi, I am looking for an alternative to system ("PAUSE") because for my program to be completed correctly I usually introduce this sentence. Normally a program in c ++ usually has the following format: #include <iostream> using namespace...
asked by 15.11.2016 / 17:55