Questions tagged as 'punteros'

4
answers

Understanding the absence of pointers in Python

In some simple applications that I have had to write in C / C ++ I have seen the ease with which certain tasks are solved using pointers . Now, more interested in another language: Python, I have noticed the absence of this concept. What is the...
asked by 04.12.2015 / 00:00
2
answers

Pointers as parameters to functions in c

Hello people, I have a small problem. I am creating a function that receives as parameters a double pointer. This function receives the parameter and assigns it dynamic memory. Once the memory is assigned, I call another function that assigns va...
asked by 03.04.2017 / 03:00
1
answer

Character strings as pointers in c

I am learning C and I understand perfectly the pointers and their relation with the arrays, but my problem comes with the character strings. We declare a string of characters like this: char cadena[] = "Hola"; is equivalent to: char caden...
asked by 25.08.2016 / 20:43
2
answers

How can I use sort with a pointer vector?

I'm trying to use sort with a vector type vector<node*> where node is a variable that I created myself. However I am not succeeding, it does not let me put that function inside the sort method. This is my code: int compOrga...
asked by 15.12.2017 / 12:53
2
answers

Insert an array in one position within another

I'm doing an exercise of POO but with pointers, and I have to insert an array into another in the position that is requested, without overwriting or losing those that are, just move it. In the function void IntArr::addElement(int po...
asked by 18.04.2018 / 20:00
1
answer

pointer to nested struct

Code: #include <stdio.h> #include<stdlib.h> struct alumno1{ int edad1; float nota1; }; struct alumno{ int edad; float nota; struct alumno1 *alu1; }; int main(int argc,char **argv){ struct a...
asked by 05.04.2018 / 11:30
2
answers

Correct handling of pointers

I'm having problems performing implementations of some of the shell commands in C. From my point of view it seems that it is due to an incorrect handling of pointers in C (I have not learned this language for a short time). At the moment I am tr...
asked by 28.11.2016 / 00:10
2
answers

Data passing from one pointer to another

In my program you have to create a duplicate function that receives a string and returns a pointer to a new string that is the copy of the previous one. My program "works" the problem is that if the initial string passed as an argument to my dup...
asked by 04.09.2016 / 07:26
1
answer

Release dynamic array memory from pointers in non-binary tree

I have this structure: typedef struct Nodo { int valor; int numSubNodos; struct Nodo *padre; struct Nodo **hijo; } Nodo; To fill it as a non-binary unbalanced tree, or rather a node can have several children and not all th...
asked by 05.04.2017 / 16:29
2
answers

I can not print the string array on the screen

#include <iostream> #include <string> using namespace std; const int NUM = 3; void hola(string &mana[]) { mana[0] = "Hola soy sergio"; mana[1] = "Mamam me quierre"; mana[2] = "Hola como estas"; } int main() {...
asked by 09.03.2017 / 01:23