Questions tagged as 'c'

1
answer

Sort stack elements A and B on stack C [closed]

I am learning how to manipulate cells in the Data Structure discipline, but having difficulties in implementing functions such as sorting and repackaging is having errors in the if loop scope. #include <stdio.h> #include<stdlib.h>...
asked by 07.05.2016 / 16:02
1
answer

List chained within Chained List

I'm having trouble with linked lists within a linked list. The program is a card game in which there is a doubly chained list of players and within each node of that list, a list (the hand) of cards. I can not add a letter to the list of letters...
asked by 23.10.2016 / 21:59
1
answer

How to convert percentages to C? [closed]

I tried to make a program to convert percentages from days to weeks, months, years, etc. But it is not working, this is the code as it is now, I do not know what the error is. #include <stdio.h> #include <math.h> #include <local...
asked by 07.12.2015 / 01:22
2
answers

Store vector file contents in C

I need to read a text file and store each word of the file in a vector position. The reading was done normally and the file was passed by parameter such as the number of words. The code performs strange storage. When I try to print, a random...
asked by 06.12.2015 / 07:13
1
answer

Problem with menu + buttons + lcd

Hello. I'm having trouble making a C language program with buttons, lcd (16x2) and a PIC18F4550. Below, I've put the program description and the code I have so far, a keyboard filter and some basic pic settings. I was trying to use mult...
asked by 02.11.2015 / 19:31
1
answer

Allocation and memory cleaning in C - how much should I care?

I am learning C from the book "Use the Head! C" (condemn me). Given a lesson, I need to create a struct called " island " with the following code: typedef struct island { const char *name; const char *opens; const char *clos...
asked by 03.11.2015 / 00:18
1
answer

Reading and Comparing file login and password in C

I'm programming my system login screen with the help of files, ie saving / reading the data within a arquivo.txt . So far I have been able to register the login and password of the user, however I am dealing with several errors when rea...
asked by 11.11.2015 / 18:16
2
answers

I can not do division with an element of vector

I made a code to simulate the Monty Hall paradox, so that I can simulate 1000 times the results and write the statistics. However, I can not divide an element from an 'array' of 'int' by an 'int', every time I run the program, when it arrives in...
asked by 24.11.2015 / 23:01
1
answer

Place and get file integers?

I have two integer variables at rp and rc , and I have to write them to a file as a way to save their value, and then get them and put them into variables of type inteiro to use in my program. To write to a file, I'm just...
asked by 31.10.2015 / 03:51
1
answer

result obtained does not match the actual result

I'm struggling and I do not know how to explain, excuse me for the title of the doubt, here's the code defined ... #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define MAX_JOGADOR...
asked by 17.11.2015 / 01:03