Questions tagged as 'c++'

1
answer

Format custom types in ostream

It is possible to modify the behavior of a stream with different options, for example: std::cout << 0xfabadau << '\n'; std::cout << std::hex << std::setfill('0') << std::setw(8) << 0xfabadau << '\n';...
asked by 17.11.2016 / 09:56
1
answer

screen print an unsigned char array with iostream

I have a console application in C ++ in Visual Studio Express 2013 with the following code: #include <iostream> #include <ostream> using namespace std; void GetValores(unsigned char* c) { // aquí va mucho código que asigna val...
asked by 21.09.2016 / 18:09
1
answer

How can I put a variable of the same class as the class I am defining?

I'm doing a problem of A * and I need to save the father and then print the route. Everything works correctly until I ask the parent node in the printing method and it gives me this error:    "error.EXC_BAD_INSTRUCTION (code = EXC_I386_INVOP,...
asked by 15.12.2017 / 12:00
1
answer

Print content of custom-type LIFO stack

I have the next class; class Estudiante { private: string nombre,cedula; int matricula; float calificacion; public: //se dejo con un destructor por defecto void anadir(int _matricula,string _nombre,string _cedula,float _c...
asked by 30.09.2018 / 18:42
3
answers

Merge arrays ordered in C ++

I need to combine the elements of two arrays interspersed and sort them during insertion. However, something strange happens when I order the second array ( arreglo2 ), since it modifies the first element of the first array ( arreglo1...
asked by 27.09.2018 / 03:12
1
answer

Operator overhead + c ++

I'm trying to create an operator overload +: Racional Racional::operator+(const Racional& r) { Racional resultado; resultado.m_numerador = r.m_numerador + m_numerador; resultado.m_denominador = r.m_denominador + m_denominador...
asked by 19.09.2018 / 14:31
1
answer

error when compiling binding to reference of type discards qualifiers

when executing a program in which among other functions, I minimize a finite deterministic automaton (DFA, for more information, link ), I use the set and map containers of the C ++ stl, but it gives me errors that I do not understand in that f...
asked by 29.10.2017 / 22:05
3
answers

C ++ API for editing three-dimensional models

I tell you that we are developing an architectural visualization project using the Unreal Engine video game engine. We have a requirement that is very complicated to complete from the tools provided by Unreal Engine, and is to change the colors...
asked by 11.03.2016 / 19:25
1
answer

Singleton and static member

Good morning, I do not understand the following line of code: Boss* Boss::s_bossInstance = nullptr; s_bossInstance is a private property of class Boss , then, 1. How is it possible that I can access it outside the same class...
asked by 09.10.2017 / 17:39
1
answer

Is it possible not to declare new memory for a dynamic arrray?

Well, I came across this, and I do not know what to think, I know that to allocate memory the operator new is necessary, however I do not understand why this code works ?, and in any case, what are the possible failures? (Maybe it's a new...
asked by 22.06.2017 / 08:22