Questions tagged as 'c'

1
answer

Error library stdafx.h [closed]

Does anyone know why it makes a mistake in this library and how to fix it? This is declared in the codeblocks header: #include "stdafx.h" #include <windows.h> #define TAM_PILHA 2 #define NUM_ENTRA 5 void empilha(int *pilha, int *top...
asked by 13.03.2017 / 12:54
1
answer

Multiplication matrix by the matrix transposed in C language

I'm new to programming and I'm trying to make a C language program that multiplies a 3x3 array by its transpose and prints the result . I'm having trouble creating the algorithm of multiplication between the matrix by its transpose. Any help wi...
asked by 10.05.2017 / 14:42
1
answer

How to reuse a function correctly in C?

I have the following functions: int divisibilidade3(int num); int divisibilidade9(int num); int testarDivisibilidade(int dividendo, int divisor); With the testarDivisibilidade function I'm going to test all functions, whether they re...
asked by 11.05.2017 / 18:05
1
answer

'Uninitialized variable' used in this function?

After compiling the program, you receive 2 warnings of the same type:    "warning: 'phrase is used uninitialized in this function" and    "warning: 'word' is used uninitialized in this function" #include<stdio.h> #include<s...
asked by 12.07.2017 / 02:16
1
answer

Generate PPM file

Hello, I have a code to generate an array of colors and a problem to make a sequence, but unfortunately I can not quite understand the logic behind it.    Statement:   Create a color palette where each pixel is colored by the value of x and...
asked by 22.06.2017 / 01:17
1
answer

Binary file storage

In the program, I need to implement a structure that represents a student (name, age, and enrollment). Using this structure, I have to write a program that reads the data of 5 students and stores them in a binary file. Implemented the structu...
asked by 22.06.2017 / 19:58
1
answer

How to store vector values?

I am a beginner in C and I am 2 days into this exercise, I was able to do it so that if you increase the vector with the realloc function, it will increase everything right, but I need it to save the values you typed . For example, I w...
asked by 25.06.2017 / 14:13
1
answer

Stack, pop function, she has to withdraw at the end

#include <stdio.h> #include <stdlib.h> typedef struct pilhaElement{ int data; struct pilhaElement *next; }PilhaElment; typedef struct pilha{ PilhaElment *head; PilhaElment *tail; int size; }Pilha; Pilha *iniciarpil...
asked by 30.05.2017 / 03:28
1
answer

Why does this error occur? - invalid application of 'sizeof' to incomplete type

When I try to compile (gcc test.c) it generates the following error: Thecode:#include<stdio.h>#include<stdlib.h>#include<string.h>typedefstructalunoAluno;intmain(){Aluno*a;a=malloc(sizeof(Aluno));//Inseredadosnoscamposdotip...
asked by 04.11.2016 / 18:42
1
answer

Data structures - List differences

Please let me know the real difference between these structures below: typedef struct { int info; struct lista * prox struct lista * ant; } tipo_lista; and this: struct noCliente { int tempoUtilizandoMesa; struct noCliente *ant; str...
asked by 01.06.2017 / 15:08