Questions tagged as 'c'

1
answer

treat filled strings character to character in c

I'm used to other languages. Now I'm in C. I have filled in a "string" character to character and when printing it, nothing appears, I do not know if it is because of the null terminator or for what reason. I would appreciate help. I just want t...
asked by 12.02.2018 / 17:36
2
answers

Concatenate char of an array in C

I have a char pointer with numbers , which would be: puntero = [1,2,4,5,\n,2,3,\n,5,2,1]; How can I make the following?: nuevo = [1245,\n,23,\n,521]; , \n is a line break, it's just to represent it. I have t...
asked by 23.10.2016 / 21:53
1
answer

Error calling functions using C structures

I am very confused in this code. I get confused because if I declare my functions first before the structures the error that appears to me is : 6: 13: error: unknown type name 'patient' Putting the functions before the structures. #incl...
asked by 04.04.2016 / 08:24
1
answer

Why is this program broken by entering a few elements?

Algorithm At the beginning the array is of length = 0. Then, in each iteration, when trying to enter an element, the array becomes of length + 1; then, said element occupies the position length-1. Goal That an element is entered int...
asked by 29.03.2016 / 04:11
1
answer

When sorting an array removes data

I am programming a genetic algortimo so that this solves problems of linear programming, I am using C language, when calculating the limit of the variables I keep the values in a float type array, I need to order that array but it erases a data...
asked by 22.04.2018 / 20:42
1
answer

warning: passing argument 1 of 'enlist' from incompatible pointer type [enabled by default]

I try to implement a Hash in C. The program compiles, but in the file myHash.h pulls the following warning:    warning: passing argument 1 of 'enlist' from incompatible pointer type [enabled by default] myHash.h file #ifndef MYHASH_H_IN...
asked by 16.09.2017 / 22:03
1
answer

Error when exporting a lot of data from the cmd in C

Help, I am trying to export this code from C to a txt redirecting the output when executing it from the cmd, but it hangs up I think because they are too much data (50,000): s what should I do? including variables char *nombre_alumno[] char *...
asked by 28.08.2017 / 18:05
2
answers

invalid pointer free ()

ERROR: (gdb) #0 0x00007ffff7a66067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007ffff7a67448 in __GI_abort () at abort.c:89 #2 0x00007ffff7aa41b4 in __libc_message (do_abort=do_abort@entry=1, f...
asked by 26.10.2016 / 19:41
1
answer

Error compiling in GCC linux

#include <stdio.h> #include <string.h> #include <stdlib.h> int main(int argc, char const *argv[]) { int a; a=50; //imprimo a printf("El valor de a: %i \n",a); printf("La dire de a: %i \n",&a); //...
asked by 29.03.2017 / 18:54
1
answer

Doubt with strcmp in C

I want to make a function to modify a name, password or email, of a user comparing the nick that was already entered in previous steps, but I always get into the Else and I do not understand why ... void modificarUsuarios(sUsuario input[],int...
asked by 06.05.2016 / 16:23