Questions tagged as 'c'

1
answer

Repetition system how to store a value

   Make a program that will give you the age, height, and weight of 25 people. Calculate and show:       The number of people over 50;       The average height of people between 10 and 20 years old;       The percentage of people weighing les...
asked by 09.10.2018 / 18:27
1
answer

Doubt on a C language question

   Write a function that receives a vector of 10 integers and returns to   number of distinct numbers that compose the vector. For example, if the given vector is v = {3, 2, 1, 3, 4, 1, 5, 5, 2} , the function should return the number...
asked by 21.09.2018 / 07:00
1
answer

How do I define a unit of measure in the value of the variable

I have a question asking me to calculate the volume value of an oil can, and thinking of that I will use float . How do I put a unit of measure, for example the variable altura = 50cm .     
asked by 05.08.2018 / 03:38
1
answer

Problem in game startup

I'm trying to run a game I made in Allegro 4, the application only runs normally on first compilation / execution. If I close DevC ++ and re-open or try to run the generated .exe file, the game stops working. After compiling the game opens, b...
asked by 05.08.2018 / 05:15
2
answers

Doubts about char in C

What does this char * and these empty quotation marks mean "?": char *directionX = ""; char *directionY = ""; If you can help me, I thank you.     
asked by 09.08.2018 / 21:11
1
answer

File with strange characters

I have a string that receives an input value from the keyboard and a file that contains a string. What I need to do is compare the string typed with the file string and see if they are the same, but I went to see what kind of string the file was...
asked by 13.08.2018 / 20:26
2
answers

Remove elements from the end of a list in C

I have a problem where my list is removing all the elements and leaving only the last and penultimate. #include <stdio.h> #include <stdlib.h> typedef struct LISTA{ int dado; struct LISTA *prox; }lista; lista *inser...
asked by 27.08.2018 / 00:41
1
answer

How to adjust the format dd / mm / yyyy

I have the following code that takes the instant computer date. #include <Windows.h> #include <stdio.h> #include <time.h> void main () { time_t t = time(NULL); struct tm tm = *localtime(&t); printf("Agora: %...
asked by 24.10.2014 / 02:25
1
answer

String Markup and Value Return

Here is my program, I need to register up to 100 products, each product is available in 5 stores and I need to tell the quantity sold of each product in each of the 5 stores. I will have a menu that will have option of registration, media of sal...
asked by 04.10.2018 / 01:48
1
answer

Double linked list and circular, memory errors with valgrind

I have the following structures: typedef struct Node { char info[40]; struct Node *ant; struct Node *prox; }NoCDup; typedef struct LDEC { NoCDup *cabeca; NoCDup *cauda; int tamanho; }ListaCDup; And also the function...
asked by 03.10.2018 / 20:09