Questions tagged as 'c'

0
answers

Doubt struct error

I am trying to make this code work but I do not understand why I get the error: pruebas.c:13:2: error: ‘array1’ undeclared (first use in this function) array1.array[0] = 1; ^~~~~~ pruebas.c:13:2: note: each undeclared identifier is reporte...
asked by 02.01.2019 / 16:05
0
answers

How to sort the data of a file in C

I would like to know how I could order the data entered by the user in alphabetical order and then show them on the screen. This is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 100 //Contiene...
asked by 02.12.2018 / 07:30
0
answers

fgetc - Segmentation fault

I'm creating a shell simulator but the c = fgetc (stdin) order causes me a segment violation if I do not enter a character. How could I solve it? I have declared the variable c of type int . Thank you very much     
asked by 05.12.2018 / 22:37
0
answers

Go from unsigned char to vector (array)

My question is this: I am programming in C and compiling with XC8 in MPLAB X. I have a sensor that returns data in the form of "unsigned char" (8 bits per data) and I would like to access the bits of that data byte. I had thought about con...
asked by 05.12.2018 / 22:31
1
answer

Error copying an array in another in c

The truth happens to me something very strange is that I copy one matrix in another as I have always done but it is badly copied I leave photo . As you can see in the photo, the first 3 columns are copied well, but 4 copies the first o...
asked by 30.11.2018 / 20:58
0
answers

Delay in Menu Pop-Up when I have the focus on DrawingArea

I have a Gtk :: ApplicationWindow class which is the main window and in a certain place I am painting a Gtk :: DrawingArea area. To handle the keyboard in the drawing area, I will pass the focus from the main window as follows: drawArea.grab_f...
asked by 27.11.2018 / 12:27
2
answers

One-dimensional arrays in c language

I have to capture the stature of 10 elements, it has to say which is the biggest and the smallest and get the average, but I have problems to get the minimum and the average. Code #include<stdio.h> #include<conio.h> int ma...
asked by 07.12.2018 / 18:28
0
answers

In C search for a name in a .txt file when searching does not find the name even if it is registered I hope you can help me

#include <string.h> #include <stdlib.h> #include <conio.h> struct clientes{ char nombre[20]; }datos; void main(){ char nom[20]; FILE *ptr; ptr = fopen("C:\programacion\proyecto.txt" ,"a+"); if(ptr == NU...
asked by 22.11.2018 / 19:54
0
answers

Problem with qsort function ordering a struct vector in C

Hello, I have a doubt, it turns out that I have problems when ordering a vector of structs based on a variable of type float (within the struct) from highest to lowest, everything works as it should unless the qsort () that is not ordering the s...
asked by 21.11.2018 / 13:58
0
answers

How to avoid flashing in console in c and the trace of a moving character

I'm doing a project for the school that consists of drawing a picture using gotoxy and printing asterisks; The fact is that this box has to be moved if I press the arrow keys. I already managed to make the painting move, the problem is that it l...
asked by 19.11.2018 / 20:18