Questions tagged as 'c'

1
answer

doubt in bit fields

I have this code: #include <stdio.h> /* * palabra de 32 bits: 0 a 31 */ struct palabra { unsigned car_ascii : 7; // bits 0 to 6 unsigned bit_paridad : 1; // bit 7 unsigned operacion : 5; // bit 8 a 12 unsi...
asked by 21.10.2017 / 17:32
1
answer

What happens if I open a file and I do not close it?

I am new to programming in ansi C. I am currently learning to manipulate files. My question is if I open a file using the function fopen, and I finish the program without using fclose, the file can be damaged or is there a pending process on...
asked by 01.06.2018 / 02:09
2
answers

Show list of integers

The program compiles but only shows the last item in the list to be entered and not the rest. #include <stdio.h> #include <stdlib.h> #include <conio.h> struct nodo{ int valor; struct nodo *sig; }; int main(){...
asked by 06.09.2017 / 18:22
1
answer

Validate input data types

#include<stdio.h> #include<limits.h> int main() { int num; printf("%d\n",__INT_MAX__); //2147483647 printf("Introduce un numero: "); scanf("%d",&num); printf("%d",num); return 0; } If I enter mo...
asked by 17.05.2018 / 01:53
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
1
answer

Search for item appearances in fix

The program must ask for the notes of the number of students entered by the user, which can be only between 0 and 10. It must be said how many 0, 5 and 10 have appeared. The entered notes that are not 0, 5 or 10 must also be said. The program...
asked by 01.10.2017 / 12:56
1
answer

error: ISO C ++ forbids comparison between pointer and integer [-fpermissive]

// Liberías #include <stdio.h> #include <stdlib.h> //Tengo el siguiente struct para nuevo1 struct proveedores { int Codigo; char Nombre [20]; char Razon_Social [30]; int Numero_Rut; int Direccion_Postal;...
asked by 02.10.2017 / 00:42
1
answer

Send message between parent and child process

Starting from this code void enviar(char palabra){ printf("Escribe una palabra para enviar de H a P: "); scanf(" %c",&palabra); } void my_handler(int signum){ if (signum == SIGUSR1){ printf("Recibid...
asked by 29.11.2017 / 11:28
1
answer

Can you define the name of a structure with a variable?

The question is as follows (keep in mind that I am just learning C): Suppose I define a structure similar to this one struct Alumnos{ char asignatura[25]; int nota; }; and I want the user to enter a last name, save it in a vari...
asked by 28.01.2018 / 22:57
1
answer

Space pointed to with malloc () is not released with free ()

In the following code; in the loop the value of ncrC-> count varies because the pointer does not restart when using free (s) and does not locate as it is due to loop the string: "Counter=". Please help. #include <stdio.h> #include...
asked by 21.05.2017 / 00:19