Questions tagged as 'c++'

1
answer

Access several files in a folder with fstream

I am carrying out a program which asks me to go through several files that are in a specific folder (they are like 500 files). I have already managed to read a file using fstream , but I would like to see if there is any way to access the...
asked by 16.01.2018 / 03:45
1
answer

Problems with setw (x)

For some reason setw (number) does not leave spaces. I have the corresponding library and I think the nomenclature is correct. #include<iostream> #include<fstream> #include<string> #include<stdlib.h> #include<time...
asked by 13.01.2018 / 13:16
1
answer

C ++: Doubt with getline ()

I am learning C ++ and in the book I am reading it explains (a bit above) how to use the getline () function, so I wrote this code to test it: #include <iostream> #include <string> using namespace std; main () { string prueba;...
asked by 11.12.2017 / 20:56
1
answer

Calling an Array in C ++

The program consists in storing elements in an array and then displaying them in   screen. The function of storing the array works but then when calling the   array in the other function shows on the screen negative and very long numbers. I g...
asked by 15.12.2017 / 23:37
1
answer

Collect an integer from a file

The program consists of writing a number (in this case 1) in a file and then opening the file and displaying it on the screen. The problem is that I do not know how to pick up an int. #include<iostream> #include<fstream> using name...
asked by 16.12.2017 / 19:57
1
answer

Error no match for 'operator *' (operand type is class)

I have the following code that performs the search in Rear order of a tree: template<class T> Lista<NodoArbol<T>>* Arbol<T>::ordenPosterior(NodoArbol<T>*origen,Lista<NodoArbol<T>>* OPos){ while(1){...
asked by 12.11.2017 / 02:36
1
answer

error expected primary expression before

I get an error that I do not understand when compiling a code, this is the code: (the function is private) void gr_simplificada::erase_epsilon(set<char> h){ set<produccion>::iterator it; set<char>::iterator i...
asked by 13.11.2017 / 11:59
1
answer

Starting int main ()

Good evening, I have a question about this initialization of the main (), our professor of this subject gave it to us like that. Can someone explain to me what is it for? The topics we are looking at are files (binaries and text) and links with...
asked by 24.10.2017 / 02:32
1
answer

Constants in a structure

I need to implement a circular queue in the following way in c ++, but the following code is Java. class ColaCircular{ private int frente; //frente cola int maximo; //capacidad cola int n; //número el...
asked by 14.10.2017 / 23:09
1
answer

Doubt about decoupling algorithm with templates

I have a situation with a queue that I made with templates When I fill the queue with data and then when I undo an item I can not re-enter any element, because it tells me that the queue is full This is the header link This is the fun...
asked by 17.10.2017 / 05:25