Questions tagged as 'punteros'

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
1
answer

How to make a pointer by reference in C

Well what I said in C ++ compiles this code for me without problems: void pasoPorReferencia(int *&referencia){ cout<<referencia<<endl; int *dir_cambio, m = 2; dir_cambio = &m; cout<<dir_...
asked by 16.09.2017 / 16:02
1
answer

Count repetitions of each letter in a string in C

I need you to guide me on how to develop a program that requests a phrase or string of text and print the times that the letters were repeated for example that the user enters the phrase Hola amigos :    H: 1       O. 2       l. 1   ...
asked by 25.08.2016 / 06:04
1
answer

Store text variable in a char array

Good I am doing a problem that they left me in the university which asks me to develop a program which must store in a variable the text: "Pablito nailed a clavito. What clavito nailed Pablito? "As arrangement char. I think that it is already, t...
asked by 12.11.2016 / 06:10
1
answer

fread and fwrite with double pointers in c

I'm trying to write an array of structures to a binary file but when I call the function fwrite does not save anything in the file. Edit: I add the page definition typedef struct Pagina Pagina; struct Pagina { char *Instrucción; char *r...
asked by 26.06.2018 / 06:54
1
answer

how to relate pointers to char with Strings

Good afternoon I need some help to get closer to my solution, in C when it is executed by console and files are included these are declared in the main statement with a pointer to char pointers (array of Strings) but then I need to store those v...
asked by 05.05.2018 / 16:44
1
answer

Segmentation fault when printing an array in C ++

I'm having problems printing an array in C ++. If I do what I indicate in the code below, you can access the data of each object in the array, therefore print: void testGetVehiculos(){ string ci = "c11"; int cantVehiculos=2; int p...
asked by 25.03.2018 / 14:49
1
answer

Language C Functional dynamic memory

I want to reserve memory for a dynamic variable and assign value in the same function to avoid duplicating code, but I can not make the value take it in the main, it only remains in the function. Thank you very much #include <stdio.h> #i...
asked by 24.12.2017 / 21:55
1
answer

Memory addresses of local and global variables

as far as I knew when a program is loaded into memory uses 4 segments: text, data, stack, and heap. The global variables are recorded in the data segment while the local variables in the stack. In addition, by theory it is known that the address...
asked by 13.09.2017 / 21:21
1
answer

Malloc and wcscpy: HEAP CORRUPTION DETECTED

I'm trying to create and use a pointer to a string and join it with another reserved string pointer with malloc , but I always get this error message: This is the code: int wmain(int argc, WCHAR *argv[]) { LPWSTR str1 = L"So...
asked by 09.11.2016 / 22:38