Questions tagged as 'c'

1
answer

How to compare string in text file with user imput and do validation?

At the end of this code, I'm trying to read the names of some countries and compare them with user input, but I'm not getting results. He keeps repeating. If it does, the program has to follow the flow normally. void cadastrarDadosAvioes(Aviao...
asked by 13.11.2018 / 20:53
1
answer

calendar printing with wrong days

Good morning guys, I made an announcement that generates a calendar for a given year but for years bisextos it is returning the days correctly but for the years not bisextos it after the dates for different days, I apriveitei the function calend...
asked by 13.03.2018 / 07:53
2
answers

How to "break" a string in pure C to assign parts to other variables?

I'm making a bid for college and I'm lost to use C because I learned to program in Python. It's a simple question: If I have a string str, how can I "break" it in another 3 to assign to three different variables? Example: str[ ] = "Bom dia...
asked by 22.11.2018 / 18:10
3
answers

Source code does not compile [closed]

#include <iostream> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { float parede, litros; printf ("Calcular litros de tintas por metros quadrados.\n"); print...
asked by 22.11.2017 / 06:52
1
answer

What is the name of this "technique"? [duplicate]

int valorNo = (p->left == NULL && p->right == NULL) ? p->key : 0; I saw this in an answer here in the stack and I have no idea how this works, much less how to "read" it.     
asked by 04.12.2017 / 19:34
1
answer

Convert value received as int to char type in C

I'm doing a college job where I have to convert a received value to char so I can write it in full for example. Help me create this function.     
asked by 08.12.2017 / 20:40
1
answer

Why is my array not ordered? (Bubble Sort)

I've fed the array with the user input, but the algorithm does not output it in an orderly way, what did I do wrong? int main() { // variáveis int vetor[5] = {0}; int aux, i=0, j=0; printf("Entre com numer...
asked by 21.09.2018 / 03:17
1
answer

Chained List in C - How to implement insert function

I'm trying to implement data in a linked list. How can I make a function to enter the login, name and value data in my list? typedef struct registro_st{ // sequência de objetos do mesmo tipo char login[50]; char nome[50]; f...
asked by 21.07.2017 / 05:12
1
answer

Calculation of length and width [closed]

Hello, I'm developing an application in Octave, which is very similar to MathLab and with C, which calculates the height and width of an object, which in this case is a seed. The program receives an input image and then binarizes it. I would l...
asked by 02.06.2018 / 16:07
1
answer

How to read a positive n number in ascending and hexadecimal order?

I have a problem with an issue and I can not resolve it. My problem is referent of how to enter these values and organizes them as the example below.    Create a program in C / C ++ reads a positive number n and prints, in   all hexadecimal...
asked by 26.05.2018 / 01:06