Questions tagged as 'c'

1
answer

Using the getline () function in C with MinGW

I've created a code for a bookstore library using Linux / GNU, and it works fine there. However, I need the code compile in Windows using GCC, and I was wondering if there is a method to use this function or if there is a simple way to override...
asked by 18.11.2018 / 01:28
1
answer

Calculating date and time

I'm using the tm framework of header time.h as follows: #include <stdio.h> #include <time.h> int main() { struct tm dt_current, dt_begin; dt_current.tm_year = 2018; dt_current.tm_mon = 11; dt_current.tm_mday = 13;...
asked by 13.11.2018 / 13:29
1
answer

Error: expected expression before 'data'

I'm doing a student enrollment program: #include <stdio.h> #include <stdlib.h> #include<string.h> /*Elabore um programa em linguagem C, que seja capaz registrar um conjunto de dados de uma turma de programação de computadore...
asked by 15.11.2018 / 07:34
1
answer

I can not return the message saying that the values form a right triangle

#include<stdio.h> #include<stdlib.h> #include<locale.h> #include<conio.h> #include<math.h> int retangulo(int a, int b, int c){ int maior; if(a>b && a>c){// iníco primeira verificação......
asked by 13.11.2018 / 00:56
1
answer

How to check if a code contains 3 letters and 4 numbers in this order?

I'm assigning the function return checks code to a flag. The idea is to make the flag trigger the loop if the code is incorrect char *leValidaCodigoAviao(char *msg, char *msgErro){ char *pNome=0, nome[MAX]; strcpy(nome, ""); int st...
asked by 12.11.2018 / 16:08
1
answer

Error reading characters

Instead of the code reading the three char variables, it reads 2 and prints the 1st. #include <stdio.h> int main() { char ch1, ch2, ch3; puts("Digite 3 caracteres, um apos o outro:"); scanf("%c%c%c", &ch1, &ch2, &am...
asked by 29.07.2014 / 13:25
2
answers

Compile error in C ++ when accessing structure in function

I am creating a code that stores the information of 3 people within a struct , but I am having a compile error when I save the age option in struct . The error is this: /home/arthur/Área de Trabalho/pj/pj.cpp: In function ‘void cadast...
asked by 02.11.2018 / 15:52
1
answer

How to resolve error in printing strings?

I'm passing a struct by reference to a function at the time of inserting the data, and again at the time of printing this data. But the "insert_element" function does not read the time float (it skips the reading), and the function "Print_dates"...
asked by 07.11.2018 / 12:15
1
answer

Use of the library in different S.

Galera, have been developing some projects in C but at some point there was a need to use the library "Windows.h". So far so good, the problem is that I developed with Linux and I researched the library it is unique to Windows and obviously it i...
asked by 31.10.2018 / 03:34
2
answers

Initialize a function that has a string pointer as an argument

I wrote a function that exchanges the letter of a string for its successor using a string pointer. #include <stdio.h> #include <stdlib.h> /* 14) Implemente um algoritmo que receba uma string como parâmetro e substitua todas as...
asked by 21.11.2018 / 18:26