Questions tagged as 'c'

1
answer

How to copy the contents of two files into a third file in c?

I need to create a file that is the copy of the contents of two other files (already exist), the user will enter the name of these two files. In my case, the first file contains: "hi, banana, cheese", and the second: "jelly, ice cream". Apparent...
asked by 11.06.2017 / 05:15
1
answer

Trash memory output function inserts in the middle of a list

Staff developed this function: tipo_lista * insere_meio(tipo_lista *aux, tipo_lista * valor, int pos){ int cont=1; //é a posição do primeiro elemento da lista encadeada tipo_lista * p = aux; tipo_lista * novo = (tipo_lista*)malloc(sizeof(ti...
asked by 25.05.2017 / 21:45
2
answers

How Binary tree removal works in C

I have several doubts about how binary tree work in C. I'm having a code and I'm wondering how tree removal works. Could anyone better explain to me what is happening on each line in the removal part? Struct struct No{ int numero;...
asked by 27.03.2017 / 17:16
1
answer

How can I tell the compiler that it is an IEEE 754?

I need help. I have, for example, a hexadecimal number 0x41140000 that is 9.25 by the IEEE 754 standard, but how to read this value (contained in an integer variable) giving cast to a float and pick up the correct value, ie 9.25. / p> What...
asked by 14.03.2017 / 03:51
1
answer

Which library to use to pause the system instead of getch?

#include <stdio.h> #include <conio.h> int main() { int x=4, y=7; printf("&X:%X &Y:%X x e y (%d,%d)\n",&x,&y,x,y); int *px, *py; px = & x; py = & y; printf("px:%X py:%X *px e *py (%d,%...
asked by 23.03.2017 / 00:08
1
answer

Is the matrix printing the same values for all indexes, why?

Create an algorithm that loads a 12 x 4 matrix with sales figures for a store, where each row represents a month of the year, and each column, a week of the month. For the sake of simplicity, consider that each month has only 4 weeks. Calcula...
asked by 23.03.2017 / 15:30
1
answer

Function remove start List

Personal I have this remove function at the beginning, it happens that when I enter numbers such as: 1 2 3, and then I call the remove function at the beginning and delete the number 2, while the correct was to delete the number 1 , because it i...
asked by 26.04.2017 / 15:55
1
answer

How to remove all nodes from a circular list?

I'm having a hard time picking up the logic of how to remove all nodes from a circular list, if anyone could give a brief explanation of concept and / or point out the errors in the code I've already done, I'd be grateful: int freelist ( Node...
asked by 25.04.2017 / 17:08
1
answer

Stack does not work correctly in Codeblocks

This code compiles both in Codeblocks and Visual Studio, but the output is different in Codeblocks. For VS I do not delete anything from the code below, just run and ready, now in Codeblocks I took these two libraries: #include "stdafx.h" #inc...
asked by 14.03.2017 / 18:45
1
answer

Relationship between structs in C

I have the following scenario: typedef struct Unidade{ int cod; } und; typedef struct Produto{ int cod; char nome[100]; und unidade; } prod; As you can see, I have a unit-type variable inside the product. How do I record th...
asked by 11.05.2017 / 19:52