Questions tagged as 'c++'

2
answers

how to make a step by reference of two-dimensional array to the constructor?

My program has a problem in being able to make a step by reference of two-dimensional arrays to the constructor of the class ||=== Build file: "no target" in "no project" (compiler: unknown) ===| C:\Users\pc\Downloads\Matrices-Costructores.cp...
asked by 20.05.2018 / 20:55
3
answers

Free memory of a variable that is pointer (doubt of nullptr)

I have a code that does the following: look for a student because of his id, I have a student arrangement: vector<Estudiante *> alumnos; and I do the search by means of a function that contains a cycle, which is the following:...
asked by 17.03.2017 / 04:25
2
answers

Problem with structures

The program consists of entering two dates and analyzing which is larger. The problem is that the second date always comes out higher (Exactly happens in the first else if ) #include<iostream> using namespace std; typedef struct {...
asked by 27.01.2018 / 20:03
2
answers

Rename a txt file in C ++

I am programming in visual c ++ 2008 for smart device. I am trying to change the name of a txt file. I have a code taken from Microsoft msdn but it does not work for me. The code compiles well and does not give any errors, but does not change th...
asked by 27.07.2017 / 09:49
2
answers

What is the error of this algorithm? [closed]

I would like to see if you could help me find the error in this algorithm, the exercise says to calculate the discount: if m> = 300 the discount is 25% - if 150
asked by 23.06.2017 / 18:34
3
answers

error: type 'FirstClass' does not provide a call operator

I'm trying to pass an object as parameter but I get an error that I did not provide a call to the object. I want to use the second definition of the constructor, so I pass it as a parameter to be able to enter the variables by default. Thi...
asked by 13.03.2017 / 21:48
2
answers

Read string and floats of a file to calculate weighted average in C ++

Good day! This question is a continuation of what I did a few weeks ago: How to use Arrays and loops to calculate the weighted average of the university? In that question Loops and Arrays were used for the calculation of the weighted averag...
asked by 07.05.2017 / 21:33
2
answers

Error trying to create an array for types of a own Class

Hello, Good morning, everyone. I want to assign a new data type of an array, for example: I want my Array to be of the Person type, but it throws me an error, I've tried it in different ways. I do not know if this can be done? One of th...
asked by 20.04.2016 / 18:07
3
answers

Segmentation fault C ++

#include <stdio.h> #include <iostream> using namespace std; struct nodeDouble{ int data; nodeDouble* next; nodeDouble* prev; }; nodeDouble* head; nodeDouble* tail; void addNode(int number){ if(head == NULL){ head = (no...
asked by 13.10.2018 / 20:56
2
answers

Warning pointers c

I have a problem in the following code and I need help to fix it. Thanks in advance float *calculaFn(int n ,Algoritmo a, Caso c){ float fn[2]; if(a==INSERCION){ if(c==ORDEN_ASC){ // f(n)'s algoritmo insercion orden ascendent...
asked by 24.10.2018 / 12:56