Questions tagged as 'c'

1
answer

Doubt regarding the inclusion of headers

Is it considered a "bad programming practice" to include a header that had already been included in another header that I included? Was it difficult to understand the above question? If so, look at the code below: # tst_1.h #ifndef TST...
asked by 09.08.2018 / 13:48
1
answer

How to create binary tree with iterative algorithm?

I'm making a program that allocates a dictionary in memory to check misspelled words in text files. The function below converts dictionary words to integers and stores them in tree structures. My question is how to write correctly and ite...
asked by 10.12.2017 / 00:22
1
answer

Error in sorting numbers

The even numbers I was able to sort, only odd numbers I can not sort. The number memory address is displayed. Link to the question: Couple and Odd ones Here's my code: #include <stdio.h> int main(int argc, char** argv) { int...
asked by 14.12.2017 / 04:00
2
answers

The whole name does not appear

In C language as I can show the whole name when you are asked to enter the user name, I think the char definition is not correct, my code is this: int main(int argc, char** argv) { char nome[100]; fflush(stdin); int idade;// para garantir que...
asked by 06.11.2017 / 23:52
1
answer

Failed to read formatted file via input redirection

I'm trying to read the following file via inbound redirection, however the program is entering an infinite loop and with totally wrong readings. When I manually enter the data the program executes as expected, stopping when I press ctrl +...
asked by 04.11.2017 / 21:59
1
answer

HashTable: Segmentation fault when inserting - C

I'm trying to implement a hashtable, in which the table would be an array of "buckets" where each contained user information, my code: #define tam_inicial 23 typedef struct user{ char nick[6]; char nome[26]; }user; typedef struct has...
asked by 18.05.2018 / 22:37
1
answer

How do I resolve struct declaration warning?

I'll send the code and warnings that GCC is reporting. Should I ignore the warnings? warnings are related as passing from struct to function Inserir(); : #include <stdio.h> #include <stdlib.h> int menu(); int...
asked by 21.09.2017 / 17:01
1
answer

Problems using setlocale () in c

Hello. I'm new to the community so if I'm doing something wrong correct me please. I'm starting to program in C, and would like to be able to use accent in my programs. I have found materials about this on various sites and everyone asks to use...
asked by 01.04.2018 / 23:54
1
answer

Evaluate increasing order with repeat structure

   Write a program to determine if a sequence of n numbers   entered by the user is in ascending order or not. The user must   provide how many numbers will be typed, that is, the value of n. I'm having trouble with this code, I did not und...
asked by 01.04.2018 / 21:39
3
answers

Printf does not print within the while

The purpose of the code is to print the values from linked lists.   Example of how the list is:    L-> [3] -> [4] -> [5] -> X, should print 3, 4, 5. However it does not. typedef struct lligada { int valor; struct lligada *prox; } *LIn...
asked by 24.04.2018 / 13:03