Questions tagged as 'c'

0
answers

How to count elements in a Binary Search Tree?

I'm trying to complete this function that looks for all the elements that point to a certain class. How can I fix my code? int log_obter_contagem_por_classe(Log **l, int classe){ int cont = 0; Log *atual = *l; if (*l == NULL){...
asked by 29.11.2018 / 22:01
1
answer

Problem in question 1046 of the URI site

I'm getting a compilation error in the URI site judgment in question 1046, although it's working perfectly on my Code Blocks. Question:   Mycode#include<stdio.h>#include<stdlib.h>intmain(){inthr_inicial,hr_final,duracao;scanf("%d %d"...
asked by 29.11.2018 / 22:54
0
answers

Binary decimal converter going wrong in C

I'm new to the programming world in C, and yesterday I decided to write a decimal (int) to binary (int) converter. Everything was apparently working, however, some results were giving a unit less, so that example: 44 which should have been 10110...
asked by 29.11.2018 / 00:06
1
answer

Removing files in c

I'm doing a job and I came in a part of removing the file that the user wants, but it reads and does not remove. to remove should i use extension (.txt)? if so how? void removeCliente() { char codigo [50]; int excl; int *p; char *...
asked by 28.11.2018 / 20:12
1
answer

How to insert elements into a Binary Search Tree?

How can I make this function work? I've been looking for an answer here on the site for some time and I still can not do it. void log_registrar(Log **l, int conta, int classe, int timer, int caixa){ Log *novo = (Log**)malloc(sizeof(Log));...
asked by 29.11.2018 / 19:04
1
answer

How to check if the seat is free and if not ask the user to type again by inserting an 'X' in the space occupied?

I need the user to insert where he wants to sit, informing the row and column that he wants, if the user chooses the position 0-1 the program will register and write to a txt file later this information, and it will enter a looping to regist...
asked by 28.11.2018 / 06:06
0
answers

Save variable in struct by pointer

I have a problem with my code that I can not solve, I think it's a simple detail, but I have not found it yet. I need to pass by reference a vector, which has a struct, but it is not allocating the data in the struct and the program closes....
asked by 27.11.2018 / 21:01
1
answer

Read a text file and separate content into variables

I'm having a question on how to split information from a text file into variables in C. Example, I have a txt file with the following data: 3 2 A D E AD DE I would like to read this file, and separate each information into a variable, for e...
asked by 11.12.2018 / 13:47
0
answers

Problem with algorithm in C

Well folks, this is the following, I'm developing a project that wants to find a word in a font soup, the rules are as follows:    The letter can be found anywhere in (East, North, South, West, Northeast, North West, South West, South West)...
asked by 01.12.2018 / 17:52
0
answers

"Undefined Reference to" error in functions

I made a code that reads a file and creates a map based on the coordinates of that file, but all code functions have the error "Undefined reference to" The compiler shows the following errors: main.c|23|undefined reference to 'Preenche_Boia'|...
asked by 02.12.2018 / 04:04