Questions tagged as 'c++'

1
answer

Function overload in C ++ passing arguments by value or by reference (Function Overloading)

Assuming we have this example of functions in C ++ void foo(int x) { std::cout << "foo(int)" << std::endl; } void foo(int& x) { std::cout << "foo(int &)" << std::endl; } Is there a possibility to different...
asked by 15.08.2016 / 13:26
2
answers

Save data to files

I need to be able to save several data in a .txt But I do not know how to do it because at the moment of saving it I keep symbols and not what I want Here's how: fprintf (archivo, "%s", cliente, "%d", apartamento, "%d", npiso)...
asked by 10.11.2016 / 01:07
1
answer

behavior of reverse_iterator with const char []

Having the following objects: const char a[]{"abcdefghij"}; // Arreglo de caracteres (longitud 11) const std::string s{"abcdefghij"}; // basic_string<char> estandar I expected these loops to behave the same: // 1) Muestra NADA,...
asked by 11.11.2016 / 11:33
1
answer

Access to attributes of a structure by means of references in C ++

I have a node structure that has the following form struct Node { bool word; int frecuencia; char c; Node* arr [ALPHABET]; }; The problem is that when you print the word shows a series of garbage characters an...
asked by 14.11.2016 / 05:41
3
answers

Problem with function call

I'm with a project where I work with several classes. One of these is the league class which stores different days with dynamic memory. On the other hand I have a case Jornada, it is this I have the following function: int CJornada::PuntsTotal...
asked by 26.03.2017 / 22:30
1
answer

Validate FLOAT data entry [duplicate]

I need the program to accept only decimal numbers. The one I did is fine, only accepts decimals, but if you enter for example -23.45jdhsdj . The numbers if you save them, although you ignore the letters and it should not be like that. Yo...
asked by 20.09.2018 / 08:29
2
answers

Arduino - Error erasing EEPROM memory in MEGA

I'm new to Arduino and I'm having a problem with Arduino ... I have 2 plates. One is an Arduino UNO and another is an Arduino Mega. I run the following program in both, that the only thing it does is clean the EEPROM memory and show how it was....
asked by 31.07.2018 / 20:35
1
answer

Array of objects with the class 'vector'

I wanted to know how you could create an array of objects with the vector class and also call the constructor method of each vector object (array). What I have done so far is this: #include<iostream> #include<vector> using names...
asked by 16.06.2018 / 02:18
1
answer

Infinite loop when I enter a character instead of an integer in C ++

I have a problem with a phone book that I am creating. When I ask for the number, if I enter a character, the loop repeats infinitely without giving me the possibility of re-entering the number whatever I do. I have those two blocks of code, the...
asked by 02.07.2018 / 12:37
1
answer

Rotate QGraphicsItem - It does not over its center

I'm trying to rotate a QGraphicsItem on its own center, so it does not move its center, just turn X degrees ... I can not make it happen, it changes places, as if the whole scene were spinning but the rest of the Elements do not turn ... but he...
asked by 31.05.2018 / 16:39