Questions tagged as 'c'

1
answer

Changing the contents of the char variable

I'm having trouble working with files and manipulating char . CODE char *fileTipoDespesaDefault; char *fileTipoPagamentoDefault; FILE *fileTipoDespesa; FILE *fileTipoPagamento; /** * tipos : 1 => Despesa, 2 => Pagamento */ v...
asked by 18.11.2014 / 13:14
2
answers

How to sum two integer arrays with pointer arithmetic?

I'm doing an exercise in which I pass by parameter two arrays of integers already defined by the user. I need now, in a third array, to store the sum of the two received arrays, in the same positions, using pointer arithmetic. Ex: vet 1 [1,...
asked by 12.02.2014 / 21:01
2
answers

How to check in C if the file is empty?

Good evening, I'm working with C, and it turns out that I have a function or method that you have to print the data, the meal markings, for students who book a meal on the system. In the method the system must check if this file is empty a...
asked by 10.01.2015 / 23:21
1
answer

Is there a difference between a compiler and an interpreter?

What's the big difference between a compiler and an interpreter? In languages like C, Java is used as a compiler. In JavaScript, for example, an interpreter is used, but I was confronted with the JIT (just in time compiler) term. How can I...
asked by 15.03.2017 / 12:46
1
answer

GCC compiler command to display #ifdef

What compiler command do I use to display this line at runtime? #ifdef DEBUG double tInicio_=clock() ; #endif     
asked by 02.07.2016 / 22:51
3
answers

Nth value of a binary search tree

I've been trying to create a recursive function from the function that lists a binary tree in order. This function would return the nth term, in order, from a binary search tree. Each node is in the following format: typedef struct nodo...
asked by 05.11.2014 / 04:07
3
answers

How to change the value between two variables without using an auxiliary variable?

I learned to program in C, but recently I have studied RUBY. Ruby allows you to change the value between two variables easily and without using an auxiliary variable, like this: a, b = b, a Without using an auxiliary variable, ho...
asked by 20.05.2014 / 05:15
2
answers

What does * (int *) mean?

I'm reading a code that has stuff like that. *(int *)ptrArray = intN; *(float *)ptrArray= floatN; It is clear that different types are being assigned to the same vector of type void* . The question is, what is the meaning of *(...
asked by 09.11.2015 / 14:09
1
answer

Simulate the Boolean type in C

What is the most appropriate way to simulate type bool in C? My teacher did it quite simply. #define bool int But I also found an excellent answer aqui ( follows a copy of the code). // Criando a enumeração: enum boolean { tr...
asked by 01.11.2015 / 15:48
1
answer

What is the purpose of the while (* variable) and if (! * variable) in the "while" and "if" statements?

In the Code Review there is a implementation of a simply linked list
asked by 08.11.2016 / 00:02