Questions tagged as 'punteros'

3
answers

Different memory addresses?

I'm working on windows 10 and codeblocks, and my question is because by doing this I have the memory position for example 0060FEFC    1st Code #include <stdio.h> int main(void){ int arreglo[4]; printf("%p\n",arreglo); //Direc...
asked by 06.04.2018 / 10:14
2
answers

Memory access

Can someone tell me what the following lines do? num = *((int*)(direccion+sizeof(char))); (*(ST_DATA*)(direccion+posTabla*sizeof(ST_DATA))).speed = num; Do the next two lines mean the same thing? *((int*)(direccion + OFF_TABLE_KEY+sizeof...
asked by 24.05.2018 / 12:01
1
answer

Change variable by call to function

I need to know if this can be done, I think with pointers it could be but I do not know what form. On the one hand we have a function cambiarValor void cambiarValor (int a){ a=a*4; } and on the other hand the main from whe...
asked by 09.05.2018 / 12:31
1
answer

The linked list does not point to NULL at the end

I have a problem with the following program. This consists of adding elements to a linked list in an increasing way, that is, the elements will be sorted in the list from least to greatest, with the lowest value being the "head" of the list and...
asked by 18.03.2018 / 05:27
1
answer

Pointer to struct in ansi C

I have defined the following globally. char buffer[32+1]; TOKEN tokenActual; int flagToken = 0; typedef enum{ INICIO, FIN, LEER, ESCRIBIR, ID, CONSTANTE, PARENIZQUIERDO, PARENDERECHO, PUNTOYCOMA, COMA, ASIGNACION, SUMA, RESTA, FDT,...
asked by 20.10.2017 / 17:14
1
answer

How can I put a variable of the same class as the class I am defining?

I'm doing a problem of A * and I need to save the father and then print the route. Everything works correctly until I ask the parent node in the printing method and it gives me this error:    "error.EXC_BAD_INSTRUCTION (code = EXC_I386_INVOP,...
asked by 15.12.2017 / 12:00
1
answer

Problem with incompatible types (double pointers)

I get the doubt having the following function that asks for a double pointer: #include <stdlib.h> void prueba(void **ap) { *ap = NULL; } with the following main: #include <stdlib.h> #include <stdio.h> void pr...
asked by 13.11.2017 / 01:49
0
answers

Help linked list overwrites string [closed]

The problem arises when I upload the data from a binary file to memory. I do not understand why the values of the string (Desc.) Of each product are overwritten (copying the description of the last product to all the previous ones) but the numer...
asked by 23.04.2017 / 00:43
2
answers

How to delete a keyword from a text in C?

I have an exercise that says: Encode a program that reads through a keyboard a keyword of up to 15 characters and a text of up to n lines (n being a constant value). The program should eliminate from the text those lines that contain the ke...
asked by 03.01.2017 / 12:58
2
answers

Fix (not matrix) with double pointer in C ++

I do not understand how to handle an array with a double pointer (it's not a matrix, it's a linear array). I did some tests with the following code: int *num = new int; int** algo = &num;//acá se pasa por referencia (no por copia), el p...
asked by 23.03.2018 / 03:26