Questions tagged as 'c'

2
answers

Parameters for external call

I use Linux and by default (or at least in my case) it does not have screen brightness control, however it has a program that can control it. The question here is that I want to get the value of the "user" and use this value in a function typ...
asked by 19.11.2016 / 03:57
1
answer

Construct an array through a vector

I put nine digits in the vector but my array comes out with random numbers, I would like my array to come out with the numbers that are in the vector below below my code: #include <stdio.h> #include <locale.h> int vetor [9]; int m...
asked by 07.06.2016 / 23:39
1
answer

Problem to assign more than one value to variable

#include <stdio.h> int main(){ int d; int e; int peca1; printf("digite um lado da peca: "); scanf("%i", &d); printf("digite outro lado da peca: "); scanf("%i", &e); peca1 = d , e printf("%i, %i", peca1); return 0; } I w...
asked by 12.05.2016 / 20:24
3
answers

How to eliminate excess space in a string?

C code to remove spaces in strings is not working. It stops at running. #include <stdio.h> #include <stdlib.h> #include <string.h> void removerSpacos(char str[]) { int i, j; int tam = strlen(str); for(i=0; i<tam; i++) {...
asked by 26.03.2016 / 18:05
1
answer

Read a number starting with 0

I'm having problems reading a number initialized with long long long long valid; scanf("%lli", &valid); INPUT: 025 The variable valid will have as content 21 and not 25 If I change f...
asked by 24.08.2018 / 15:55
1
answer

Accessing variables dynamically in C language

I understand that it is possible to access variables dynamically in JavasScript, but doing this in C, I do not find anywhere. Follow the code in Javascript: var n1,n2,n3,n4,n5; n1 = n2 = n3 = n4 = n5 = 0; // define que todas essas variáveis...
asked by 09.01.2016 / 05:01
2
answers

Error: "invalid operands to binary expression ('char *' and 'char *')"

I need to create a string that contains "To Mr.:\n" and the name of the person in question ( pessoa->nome ). char* endereca(Pessoa* pessoa) { if(pessoa->sexo == 'M') { char *msg; msg = (char*)malloc(7*size...
asked by 11.10.2016 / 18:59
1
answer

too many arguments to function 'address * find ()'

I'm trying to compile this code in DevC ++ but still giving this error    [Error] too many arguments to function 'address * find ()' #include <stdio.h> #include <stdlib.h> #include <string.h> struct endereco { char...
asked by 17.11.2016 / 19:19
1
answer

How to compare vectors in C

Hello, I would like to understand why my code does not work. I'm trying to develop a galaxy application and I can not seem to get the letter typed to be compared to the letter in the vector, what am I doing wrong? Follow the code: #include&...
asked by 18.10.2017 / 20:23
2
answers

Program that adds / multiplies 2 numbers and what is between them and prints

I think the logic of this program is right, but the result is going wrong. Make a program that receives two numbers X and Y, where X < Y. Calculate and show: the sum of the even numbers of this range of numbers, including the numbers ente...
asked by 17.09.2015 / 21:03