Questions tagged as 'c'

1
answer

Help in struct C, failing to feed

Good morning, I'm creating this simple code, just to read, and display, this information of a vector, type struct . But when executing this code, at the time of execution, I can not feed the date or the membership, as it is explicit in...
asked by 10.07.2016 / 17:40
1
answer

Insertion sort in double-linked circular list

I'm having trouble insertion sort, it's probably in the stop condition, the problem I'm already experiencing with this problem and so far I have not been able to get out of the place. Could someone give a light? Thank you! void ordena(Lista *p...
asked by 13.04.2016 / 17:30
1
answer

How to use realloc () dynamically in struct allocation?

I have a struct TMedidorEletrico *medidor; structure, and it is necessary to reallocate the memory for this structure dynamically until the user closes the loop . Memory must be relocated one step at a time , but when invoking the fun...
asked by 16.09.2015 / 01:52
2
answers

Structures and selection of conditionals

Good afternoon! I am doing a program that reads various cow data: among them age, production, etc. However I am in doubt how I can break the for when typing code = 0. As it is in the program, only other data will be requested if code is diffe...
asked by 21.11.2015 / 16:29
1
answer

Chained list without head in c

I would like to know how I create a function to remove at the top of the headless list. #include <stdio.h> #include <string.h> #include <stdlib.h> #define MAX_NOME 50 typedef struct pessoa{ char nome[MAX_NOME]; int...
asked by 25.09.2015 / 20:23
1
answer

String reading problem

I am making an algorithm that gets cases , then a name with surname , a and a size . It should make a comparison and print them sorted by color in ascending order, in descending order and the names in ascending order . This par...
asked by 13.06.2015 / 15:56
2
answers

How to receive a number X ranging from 0 to 10 ^ 100 in C?

I have a question that can have as input an X number that can be from 0 to 10 ^ 100. I am getting the values / entry number as char to facilitate. But you can not create a static string / vector of char that behaves this way. How t...
asked by 31.03.2015 / 17:27
1
answer

Reading file in C

I have the following structure for reading each line of a file: fclose(arq); // fecha o arquivo para em seguida abri-lo em modo leitura apenas arq = fopen(url, "r"); if(arq == NULL) { printf("Erro, nao foi possivel abrir o arquivo\n"); } e...
asked by 08.11.2017 / 00:14
1
answer

How is a pointer variable for integer stored?

When we declare: int* x; How does the compiler compile this and how does the computer (would it be better to say operating system because it is the one that manages the memory) does this? I mean, S.O. reserves a space in memory t...
asked by 23.09.2014 / 23:51
4
answers

Language C - Prime numbers in vectors

I'm solving exercises, in C language, on vectors. The exercise is as follows: Make a program that loads a vector of 10 integers, just show the prime numbers and their respective positions. I have decided the exercise, but my code is only c...
asked by 09.07.2014 / 23:00