Questions tagged as 'c'

1
answer

Check data received by user

How can I check if the user typed a data in the way I'm expecting? For example, I want it to enter an integer value. How do I know if the value you typed was an integer and not a char or float , and if the entry is not an integer...
asked by 11.05.2018 / 20:40
2
answers

Use of condicinals in macros

Good evening! I want to test a condition that will be implemented in the macro. The value for the test will be informed by the user. My code generates an error when compiling. What can it be? Thanks! #include <stdio.h>. #define Epar(x)((...
asked by 21.05.2018 / 02:52
1
answer

Rewrite numbers of at most 2 digits of the input to the output

I need to rewrite 2-digit input numbers into the output , stopping processing input after reading the number 42. Input: 1 2 88 42 99 Output: 1 2 88 My code is like this, I can not understand what's wrong: #include <...
asked by 03.01.2018 / 14:51
1
answer

I am in doubt in this puzzle, I can not find the error in the program

Hello, I'm in doubt about this puzzle. I can not find the error in the program. int main(){ char n_a[500] char cit[500]; float codigo,n1,n2,n_l; printf("-------------------------------------------------\n"); printf("Nome do aluno: "); scanf("...
asked by 01.04.2018 / 19:45
1
answer

Resolve operation with Set

   Question 1 - Consider the set X = {x ∈ Z: 1 ≤ x ≤ 32}. Implement a program in C that performs the following statements.       Create three integer vectors of size 12: vector0 [12], vector1 [12] and vector2 [12].    Store in the vector0 the...
asked by 24.05.2018 / 23:50
1
answer

http requests using the C language on windows? [closed]

How to make http requests using the C language in windows? No need to post code, just a good reference is enough for me :) But if someone has an example it will be of great help;)     
asked by 28.05.2018 / 23:43
1
answer

execute grep command in C language and return result

void main() { char comando[2000]; char resultado[500] sprintf(comando, "grep '[0-9]{50}-' input.txt); resultado = system(comando); printf("%s\n",resultado); } I need only 1 match, and return the value in result, the above...
asked by 19.12.2017 / 15:04
3
answers

How to replace vowels by @ [closed]

I'm doing a college assignment that asks for a program where the user types the string [20] and I return the inverted string and the vowels replaced by @s. How do I do this?     
asked by 08.12.2017 / 01:12
1
answer

How do I read and separate save data separated by semicolons and commas?

Good night everyone, I'm doing a program in c that has to read a file and save the data, each line of the file representing the data of a client, how do I save the data by separating it by "; " and ","? The file to read is: .txt file 1 ; Fami...
asked by 23.06.2017 / 22:27
1
answer

Error at the time of running the program hangs.List list (Resolved) But I am still in doubt

I have an error that only appears during the execution of the program. I would like someone who has the knowledge of why this happens, can you explain. #include<stdio.h> #include<stdlib.h> struct TNoDeCaractere { char caractere; s...
asked by 29.10.2018 / 01:29