Questions tagged as 'punteros'

3
answers

Declare as an attribute, a pointer to my same type of variable in C ++

My problem is this: I have a class Nodo , which has as an attribute an array of pointers to to the same type (as to make a tree) and then I have a daughter class NodoAvl that must inherit that attribute but the pointers must...
asked by 05.11.2016 / 20:33
1
answer

Access elements of a matrix through pointer arithmetic

How can I access the elements of an integer array using pointer arithmetic? I am clear that to access those of a vector is such that *(vector+"posicion") but for a matrix I do not know how I can do it. I know that they can be writte...
asked by 15.06.2017 / 11:08
1
answer

List linked by reference to a method, c ++

I'm in need of help. I'm trying to read a csv file to pass the fields to a linked list and then pass it as a reference to some methods in a class. while(linea!=VACIO){ Lista<std::string>*datosCultivo; cultivos.datosLista(linea, d...
asked by 26.05.2018 / 06:21
1
answer

Simple linearity problem in C

I have a question about this procedure. Could this exchange of variables be simplified without using an auxiliary variable? Practicing with pointers I came up with this dilemma and I do not know another solution to this problem. The idea is t...
asked by 14.07.2018 / 18:33
1
answer

"Segmentation Fault" in Double Linked List

I hope you can help me visualize the error in the following code. I've been studying all types of lists lately. In this program I focus on inserting an element at the beginning of a DOUBLY LINKED list. As soon as I started studying these type...
asked by 04.04.2018 / 03:37
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
2
answers

Error when deploying an array pointer in C ++

I'm doing college programming exercises and I'm with this:    Write a program in which a type is defined, PunteroArray, pointer to ARRAY of a thousand positions whose data   stored is a pointer to int:        Declare and write a procedure,...
asked by 19.06.2017 / 22:05
1
answer

Go through a data structure looking for them to be the same (reference to memory)?

I have a class that is Place that has a series of data, these I store in an array given that at the time of constructing the objects there can be several with it, so the idea is to go through the array but comparing at the level of reference....
asked by 02.12.2016 / 11:07
2
answers

Constant pointer to struct volatile

In my implementation, I use a pointer to a struct that can be modified at any time from my code ; I want that, from the exterior of my code, that pointer can be accessed, but only for reading (to be able to use it in certain func...
asked by 16.12.2016 / 11:59
2
answers

Doubt with linked lists (pointers) C ++

The exercise in question is this: I already have this code in the header: #ifndef HEADER_H #define HEADER_H7 //Tipo dato Nodo struct Nodo { int dato; Nodo* izq; Nodo* der; }; //Tipo dato Estructura struct Estructura {...
asked by 21.03.2017 / 01:41