Questions tagged as 'c'

1
answer

Cloud9-Problem executing code

The following code: #include <stdio.h> void main() { int num = 123; printf("O valor de num = %d e o valor seguinte = %c", num, num+1); } Returns the following result in the Cloud9 terminal:    The value of num = 123 and th...
asked by 16.05.2014 / 14:27
2
answers

Undefined reference to MIN

When compiling my discarded media program, the following error occurs. Remembering that I used MIN to discard the smallest value between a, b, c and d.    My program.c :( .text + 0x8b): undefined reference to 'MIN'   [Error] ld returne...
asked by 07.04.2015 / 03:26
2
answers

Why does the program quit before scanf

I have the following code: #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { float a, b, c, delt, c0, c1, c2; char s; int op = 1; printf("Welcome.\n\n"); while (op == 1) { pri...
asked by 25.03.2017 / 22:56
3
answers

C polymorphism [duplicate]

Is it possible to use Polymorphism in a structured language like C ? Languages like c++ , Java , etc (Object-oriented languages), have structures capable of inheriting functionality for code reuse (One of the reasons),...
asked by 04.02.2017 / 06:42
2
answers

Bug in print

Could someone answer me because in cpf is printing the value 6422276? #include<stdio.h> #include<stdlib.h> typedef struct{ int dia; int mes; int ano; }data; typedef struct{ char nome[100]; data nascimento; int cpf[10]; }ficha; f...
asked by 04.07.2018 / 01:55
2
answers

Calculate memory address by pointer arithmetic

Suppose the elements of the v vector are of type int and each int occupies 8 bytes on your computer. If the address of v[0] is 55000, what is the value of the expression v + 3 ?     
asked by 14.04.2018 / 22:07
5
answers

Variable is not displaying the expected result

In reading the variable at the end to display the value, it displays a garbage, here is the statement along with my code.    Make a program that recognizes the age, height, and weight of five people, compute and show:       The number of pe...
asked by 11.05.2016 / 19:50
1
answer

How to pass an integer with two digits, causing each digit to be in a position in the vector?

I make the sum of two numbers 5 and 5, how to pass the result (10) as follows : vetor[0]=1 and vetor[1]=0 , ie separate result for each position of my vector, without the vetor[0] receiving the full value that would be ve...
asked by 08.06.2016 / 03:42
1
answer

invalid digit "9" in octal constant arduino

I have a problem with my temperature measuring function. #include "max6675.h" int ktcSO = 8; int ktcCS = 9; int ktcCLK = 10; MAX6675 ktc(ktcCLK, ktcCS, ktcSO); void setup() { Serial.begin(9600); delay(500); } void loop() { Serial...
asked by 31.01.2018 / 16:37
2
answers

Conditional operator?: is not working

I can not use the?: #include <stdio.h> int main() { int num1 = 10; int num2 = 20; int resposta; num1 < num2 ? printf("sim\n") : printf("nao\n"); // O erro acontece aqui ao compilar num1 < num2 ? resposta = 10 : respost...
asked by 04.02.2018 / 00:27