Questions tagged as 'c++'

2
answers

C ++ no match for 'operator + =' (operand types are 'float' and 'std :: chrono :: durationlong int')

I am trying to calculate the average execution time of a program, for 10 executions, for this I use the library chrono of C ++ 11, however, I'm getting an error that says there is no operator to make += , I understand that variables...
asked by 22.11.2018 / 22:14
1
answer

Difference between std :: uninitialized_copy and std :: copy?

I'm trying both and they always return the same to me. Is there a specific case where only one of the two can be used? // Example 1: std::allocator<int> alloc; int arr[5]{7,7,7,7,7 }; int *arr2 = new int[5]{5,5,5,5,5}; std::uninitia...
asked by 14.12.2018 / 15:09
1
answer

How to modify a .txt file from c ++?

I want to modify a file .txt from a program developed in c++ , I already have a developed code that creates the file and also reads it, but it does not modify it and I can not find how to do it. My code is as follows: #include...
asked by 20.08.2016 / 23:00
2
answers

C ++ Problem printing matrices

I want to do this problem: link    Problem       Given a square matrix of size "n", you must do   that your program turns it 90 degrees to the right.       Original matrix 1 2 3 4       Matrix Rotated 90 ° to the right 3 1 4...
asked by 06.10.2016 / 05:02
3
answers

Difference String and StringStream

I'm looking at the sstream bookstore and I've run into stringstream. Googleando came to the conclusion that it is the same as string, but I can not understand it. According to my understanding, is it to create a string and use it as a "cin" t...
asked by 04.04.2017 / 16:39
3
answers

How much space can occupy an integer or data

Hello I understand an integer occupies: 4 bytes. But my question is if the integer is very large how much it can occupy or 4 bytes is for each whole number. That was my doubt. And it is not only for that reason but also to understand if another...
asked by 15.12.2016 / 15:41
3
answers

Read a memory address stored in a text file

I need to read the memory address of a pointer from a file, since I implemented the function, an integer function that when reading the file it returns the stored address: int Cargar(std::string nombre) { std::ifstream archivo; archivo.open(...
asked by 13.08.2018 / 00:58
3
answers

Doubt about the behavior of an integer variable

I have made the following program that calculates the inheritance based on the number of children: #include <iostream> using namespace std; int leer_datoi() { int dato; cin >> dato; return dato; } double leer_d...
asked by 30.10.2017 / 23:57
2
answers

Operation of the delete operator in C ++

I do not understand how the delete operator works in this function since std::cout << datosCli[0] << '\n'; , which is executed after delete[] datosCli; , continues to print the String on the screen. Should not you lose th...
asked by 30.10.2018 / 23:56
2
answers

I do not understand the use of std :: setw

I'm doing an exercise in a C ++ book that I use to learn the language, and I can not fully understand the use of std :: setw and its use in conjunction with std :: left (default) and std :: right . In fact, I do not know how, I've found the...
asked by 02.05.2016 / 19:56