Questions tagged as 'c'

2
answers

Incorrect Print Values

I do not know where I'm going wrong and are printing incorrect media values. #include <stdio.h> int main (){ int i, num, soma, maior, menor; float media; printf ("Informe 10 valores:\n"); for (i=1; i<=10; i++){ scanf ("%d", &...
asked by 23.10.2017 / 20:05
3
answers

print of char returns random character

Compile the code below without error. When I enter the word (or phrase), printf returns a random character like 0 � a etc. The program should read a word (or phrase) and printf show the word (or phrase) that was written b...
asked by 03.11.2017 / 02:36
2
answers

How could I insert the structs into a list? [closed]

#include "stdafx.h" #include <iostream> using namespace std; struct FICHA_INSCRICAO { char nome[50]; char cpf[10]; char logradouro[100]; char bairro[20]; char cidade[20]; char estado[1]; char email[50]; cha...
asked by 07.10.2016 / 23:09
2
answers

Multiple conditions in an if

I'm having a code here, and I need to put multiple conditions inside an IF. In case I need to put it this way: if (X->meia != 's' || X->meia != 'S' || X->meia != 'N' || X->meia != 'n') { printf("\nDigite S ou N!!\n"); } Bu...
asked by 20.11.2015 / 20:02
2
answers

Programming language directly with hardware [closed]

I will make applications that require a direct connection with the hardware, for example, a programmable mini-robot that receives information from one sensor and sends it to the programming to treat and return the correct action to another card...
asked by 03.08.2015 / 19:46
2
answers

Assignment Doubt in c

Here's my code, why if there is change in the other variables, am I not just changing the row by the variable value? what reason for the others to change? int a = 1, b = 2, c = 3, valor = 0; valor = a; printf("%d\n" , valor); valor = b++; pr...
asked by 08.08.2018 / 01:36
2
answers

Error invalid conversion from 'int' to 'int *' using -fpermissive

I'm following a series of C-videos ( link ), but I've encountered a problem. First I ran this code: #include <stdio.h> int main(void) { int x = 10; int *resultado; resultado = &x; printf("Valor &x = %d", resu...
asked by 12.11.2015 / 01:32
3
answers

Problem with pointer and recursive function

The code is this: Node * search ( Node ** root, int mats ) { if ( ! ( * root ) ) { return NULL; } else { search ( & ( * root ) -> esq, mats ); if ( ( * root ) -> person.mat == mats ) {...
asked by 14.06.2017 / 02:31
2
answers

Creating a dynamic array that stores text with breaks

Attempt to create a dynamic array using malloc() . I am in doubt if the parameters I submit for the different function cycles will be right. int size=0,i,j,n=20; char str[]="Ola. Tudo bem?\n Sim e contigo?\n Comigo esta tudo bem! Que ten...
asked by 10.11.2017 / 09:33
2
answers

How do I point (with a pointer, of course) to a string, so that I can then start it?

I'll give you an example of how I'm doing but it's wrong and I wanted someone to help me fix it. #include <stdio.h> void main() { char *p; char nome[21], outronome[21]; scanf("%s", nome); * p =...
asked by 10.06.2018 / 01:16