Questions tagged as 'c'

2
answers

Conflict types in function

I'm trying to create a list structure using struct . But when I compile my code, I get an error because, even specifying Lista , it has a problem. Follow the complete code: #include <stdio.h> #include <conio.h> s...
asked by 16.08.2016 / 19:52
1
answer

Insert function in list

Hello. I'm developing this function below: void inserir_inicio (tipo_lista * p, tipo_lista * novo_no) { novo_no -> prox = p; p = novo_no; } And in main I'm calling: inserir_inicio(&p, cria_no(1)); imprimir_lista(p); A...
asked by 22.05.2017 / 15:07
2
answers

Error while running program

#include<stdio.h> #include<math.h> int main ( void ){ int x; int i; printf("Input the number (Table to be calculated) : "); scanf("%d", x); for( i = 1; i <= 10; i++){ printf("%d x %d = %d", x, i, x*i); } return 0; }...
asked by 20.12.2016 / 01:23
2
answers

Doubt in string, and comparison

I'm doubtful in the following exercise:    Write a C program that receives two strings via standard input and   whether the second string is contained in the first string, that is, if the   second string is a segment of the first. You may con...
asked by 05.05.2016 / 16:04
2
answers

How to make a function use as many arguments as are given to it

Is there any way to make a function use multiple arguments without their declaration? For example: #import<stdio.h> #import"rlutil.h" //para as cores void a(color,string){ setColor(color); printf("%s",string); setColor(15);...
asked by 26.03.2016 / 18:48
2
answers

Error comparing two strings C

I enter a value on the command line. That is in binary vector. But if it is not returned to the printf message. But my problem is that it always goes into if , regardless of whether it is binary or not. #include <stdio.h> #i...
asked by 24.09.2016 / 10:37
2
answers

Conversion from byte array to string when compiling revealing string in compiled code in C

I'm using the function below to do the conversion from byte array to string , but when parsing the compiled code I notice that string is shown clearly ( using a hex editor ) , which I do not want. char arr_code[] = {79, 99,...
asked by 16.09.2016 / 07:54
2
answers

how to capture what is printed on the console by means of a command into a vector in C language

When I do some command in the linux console, for example man fprintf , a series of information is printed on the screen. I need to collect this information that is printed on the screen but instead of being printed on the screen it is f...
asked by 21.12.2015 / 23:32
1
answer

Reverse Array

I want to invert an array, for example: void exercicio5() { float array[6] = {10.1, 11.2, 12.3, 127.0, 512.17, -2.5}; float inverso[6]; int cont, x = 6; for (cont = 0; cont < 6; cont++) { x--; inverso[x]...
asked by 04.06.2016 / 01:57
1
answer

How to create an array with roulette colors?

#include<stdio.h>intmain(void){charcor[35];//declararvetorpararecebernomedascoresintnumeros[35]={0};//declararvetorparareceberonumerorespectivodascoresinti=0;intentrada;for(i=0;i<=35;i++){printf(" DIGITE O NUMERO: ");// atribuir os val...
asked by 13.05.2016 / 23:19