Questions tagged as 'c++'

1
answer

Calculate successors of a node in a directed graph

Given the following exercise:    Consider the graph_t class,   that represents a graph directed by an incidence matrix, in which the position (i, j) in the matrix M_ represents the value of the arc that goes from the vertex i-1 to j-1 in the...
asked by 23.07.2017 / 21:42
1
answer

Use array in VC2008

I have the problem of not being able to use arrays in visual studio 2008 in c ++ I have installed visual studio 2008 professional with SP1. I have been searching the internet and apparently it is possible to include arrays, but I can not do it....
asked by 03.07.2017 / 11:48
1
answer

How to handle text files to save scores of a game?

The idea is that when the user dies he enters his name and it is saved along with his score keeping the names and scores that were already saved. the problem is that the code I have only overwrites the previous file and saves the last name enter...
asked by 15.06.2017 / 03:59
1
answer

How does Copy-and-swap work?

I've been reviewing C ++ 11 and C ++ 14 news, and I do not understand how Copy-and-swap works As an example: class dumb_array { public: // ... friend void swap(dumb_array& first, dumb_array& second) // nothrow { // enable ADL (...
asked by 09.06.2017 / 14:28
1
answer

Difference between different types of return

What is the difference of adding a return -1 and a return 1 to any function of type int? Reading the code of a program that circulated in a forum, in some functions it used return -1 and in others it used return 1.     
asked by 07.06.2017 / 01:41
1
answer

tableView_clicked does not respect the order of the data

void MainWindow::on_**tableView_clicked**(const QModelIndex &index) { if(!index.isValid()){ return; } btnEdit->setEnabled(true); btnDelete->setEnabled(true); btnSave->setEnabled(true); btnImg->setEn...
asked by 30.05.2017 / 10:05
1
answer

Perform search in DataGridView using textbox c ++

Hi, I would like to know if someone can help me perform a search, in a DataGridView that from a TextBox when writing, that is, in the eventeo KeyPress the table will be refreshed to see the record. As you can see in the image in t...
asked by 10.05.2017 / 20:52
2
answers

Using ".get (char a)" in C ++

void estadisticas ( const string & nombre , bool & ok , Estad & sts ) { ifstream fich ; fich . open ( nombre . c_str ()); if ( fich . fail ()) { ok = false ; } else { inic ( sts ); char c;...
asked by 10.05.2017 / 19:03
1
answer

Error in output by cout from main arguments

Good afternoon; I have a loop to get the main arguments that have been used in the command line, however, after removing them, the following cout are not shown. I understand that cout with < < receives reference variables. If I try to take...
asked by 07.06.2017 / 21:12
1
answer

How to scroll through a list and display the data by console in QT creator c ++

Good morning, I am creating the following method: void MainWindow::agregarProyecto(QString nombre, QString descripcion, QString directorio) { proyecto *unProyecto = new proyecto (nombre,descripcion,directorio); qDebug("Se va agregar el...
asked by 15.05.2017 / 16:12