Questions tagged as 'c++'

1
answer

error when compiling main c ++ file

There is an error that has come up to me several times, I have modified the classes to remove that error, but it keeps coming out when executing the main, I do not know what it is referring to, we appreciate help. this is the main code: #in...
asked by 27.09.2017 / 01:27
1
answer

Extract data without using extra variables

I want to extract a data from a class; Currently, I use an auxiliary variable for it. To work, it works ... but I was wondering if it could be done in another way, saving me the variable inside the function Envoltura::result( ) : #inc...
asked by 15.03.2018 / 21:13
1
answer

Not Suitable User Defined Conversion error with use of templates

I'm doing a program in C ++ that overload the operators. For example, for the operator * you would like it to be multiplied: Cuadrado a(2.1); Circulo b(1.3); Circulo b(4.3); Triangulo x= a * b * c I have created the operation Cuad...
asked by 28.05.2018 / 12:45
1
answer

Error compiling passing const

There is an error that does not stop to compile and I do not understand, I explain, I pretend to make the power of a language, eg given a language L {0,1}, do L ^ 2, that would give us { 00,01,10,11}. That's what I intend to do in my code, ho...
asked by 04.10.2017 / 02:27
1
answer

On the use of smart pointers

Suppose we have the hypothetical case where pointers are used for all types of variables. More exactly, we have the following procedure to read the elements of a one-dimensional array: void leer_arreglo(int *&v) { int *i = new int;...
asked by 13.05.2018 / 17:34
2
answers

Finish a vector of arrays with a while

Basically I want to fill a vector of strings (I thought of doing it with a for), the vector will receive the data through the keyboard (with cin). So far so good but I have no idea how to do to stop the cycle and stop filling the vector at the t...
asked by 12.05.2018 / 19:15
1
answer

How to pass memory blocks (pointers) from C ++ to C #?

I have a small problem that I hope you can help me. I have this code in c++ : __declspec(dllexport) unsigned char* ProcessFrame() { VideoCapture cam; cam.open(0); Mat imagen; unsigned char* result; cam >> i...
asked by 28.08.2017 / 10:50
2
answers

Pass content from .txt file to character array in c ++

I have to pass a text file to an array of characters. I have done the following function: char* loadData(string fileName, int& longitud) { char* arrayTemp = NULL; ifstream file; file.open(fileName); if(file.fail()) {...
asked by 08.10.2017 / 21:30
1
answer

Memory reserve with std :: vector resize

for a data structure std::vector<3Dpoint> v; with 3Dpoint : struct 3Dpoint { float x, y, z; 3Dpoint(float _x, float _y, float _z){ x = _x; y = _y; z = _z; }}; I try to resize the vector s...
asked by 11.10.2017 / 17:58
3
answers

Find the person who is younger

I have two arrays in C ++ , one with the names of people and another with the ages. How could I find the person younger and show it on the screen? Example:    Alejandro 37   Tatiana 28   Maria 52 ... and show on the screen, The...
asked by 16.07.2017 / 22:47