Questions tagged as 'punteros'

3
answers

How to convert string to char *?

I wanted to ask about how to convert a string to a char *, the case is the one shown below, where I have a defined string and I want to name the variable x using .setName (), but it receives a char *, so that I can not simply place variable name...
asked by 13.11.2018 / 18:32
2
answers

Doubt about pointers

A few days ago I was doing a project in CodeBloocks, referring to classes, member functions and pointers, which is about entering 2 numbers (1 in each function) and then adding it in another function; Just like this. #include <iostream>...
asked by 16.08.2018 / 06:43
1
answer

Problem removing blanks at the end of a char type pointer *

I have a problem with this function. I'm trying to eliminate blank spaces at the end of a char * pointer. Something like this: char *ptr = "Soy un puntero dinámico y me sobran espacios al final "; With the difference that this is s...
asked by 12.06.2018 / 14:23
2
answers

Release memory c ++ (delete)

I'm working with linked Lists (using pointers). In a memory reserve function (using new) as long as% co_of% In another function I release all the memory (with delete) and according to the project statement I should be able to generate a Li...
asked by 23.11.2017 / 18:15
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
3
answers

Segment Violation

The problem is that when executing the program it produces a segment violation and I can not find the reason why. The goal is to reach the "error detectado en la tabla" line #include <stdio.h> #include <stdlib.h> #define SI...
asked by 13.05.2018 / 03:31
2
answers

Doubt with Pointers to fix Structure Variables

My question is, why is the pointer const wDeck , which is as a parameter in the functions fillDeck , shuffle and deal , does not have brackets at the end (that is, it is not a pointer to an array unlike the other paramet...
asked by 23.01.2017 / 18:11
2
answers

Failed to work with pointers

char * trocear(int num){ char *salida; int i=0; while(num/10>0){ *(salida+i)=num%10+'0'; num=num/10; i++; } *(salida+i)=num+'0'; i++; *(salida+i)='char *n; n=trocear(123456); cout<<...
asked by 01.12.2018 / 12:33
2
answers

When is a pointer needed in a return of an operator function?

I am studying for a term and I want to know when we use the return of the operator functions. For example, why is the pointer needed in return !((*this)==v); ? class vecteur3d { float x; public : vecteur3d(floatx=0.0)...
asked by 10.05.2017 / 14:27
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