Questions tagged as 'c'

1
answer

Doubt with LOOP FOR (now in PIC C COMPILER)

How about friends again, they already answered my question, but I work on a compiler of C, now I'm programming on pic C compiler, but it marks me that the second loop becomes infinite (it's always true, it executes normal, but at end begins to t...
asked by 05.01.2018 / 18:40
1
answer

Difference between assigning variables by value or reference

I have seen several pieces of code in c where when assigning a value to a variable they do not use the '&' and I've read that it's something about value or reference, could someone explain to me? char userName[25]; printf("Ingresa tu nombre...
asked by 04.01.2018 / 16:59
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

Format specifiers in printf

Why this line exceeds 80 characters in width of a GNU / Linux or OSX console: printf("%16s %16s %16s %16s %16s\n", "Artículo", "Cantidad", "Precio unitario", "Descuento", "Total"); Thanks in advance. Best regards     
asked by 01.11.2017 / 18:31
2
answers

violating the core using C threads

This is the process that is loaded in several threads void *recorreNumero (FILE *entrada, char nomT[], int numT){ int t = 0, numero = 0 ,primo = -1; char linea[13]; FILE *salida; rewind(entrada); fgets(linea,sizeof(linea),entrada); sali...
asked by 03.11.2017 / 19:32
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

Access to structure data [closed]

The program would have to work with lists in C. It has to be able to read integers that the user enters and make operations with these numbers, such as insert elements in front, show an element and also the possibility of deleting an element ent...
asked by 11.09.2017 / 23:35
3
answers

Block control if else

The program executes without problems, but always writes the last statement printf("lo siento, no puedo calcularlo"); Is there any way I can not get out of this condition? #include <stdio.h> #include <conio.h> int main...
asked by 15.09.2017 / 01:55
1
answer

Calculate the age by current date in C

I have made a simple code to keep data of people in a structure and it occurred to me, to get the age of the person using the datedate method () subtract it in some way with the date of birth introduced .. Code: struct fecha{ int dia;...
asked by 29.08.2017 / 12:29
1
answer

spiral matrix in c

I did an algorithm to generate a spiral matrix given the amount of rows and columns, but it does not work for all the matrices and I do not know very well what the error could be #include <stdio.h> int main (void) { unsigned short fi...
asked by 20.08.2017 / 06:02