Questions tagged as 'c'

0
answers

Doubt with pipe

I'm starting in C and I'm currently studying on pipes . I copied an example from the book to see how it works and then try it on its own, but it did not occur what was supposed to happen. Code 1: #include <stdio.h> int main() {...
asked by 06.04.2018 / 02:52
0
answers

Pass vector of type struct as parameter of a function in C

I need to create a function that is in a .h file that generates random numbers n (user-defined and passed by parameter in function), and fill the set b with the generated values. tConj.cpp file TConj a,b,c,d; int elemento, i,op; lon...
asked by 10.04.2017 / 22:11
1
answer

importing and exporting .txt FILE file in C

The algorithm should read from 1,000 to 15,000 real numbers, add all and perform a media, I did several import processes, and export the final result, but none copied. #include <stdio.h> int main(void) { int count,count_auxiliar; float m...
asked by 17.04.2017 / 17:35
2
answers

C - Print the N-prime prime number

The exercise asks the program to read an N number and print out the N-numbered prime number. Ex: I enter with N = 3. The program will have to print The third prime number, that is 5. Other examples: N-esimo (2) = 3, N-esimo (5) = 11. I did the f...
asked by 01.05.2017 / 18:02
1
answer

exercise Floating-point error

I have a list of floating point errors and I'm having some difficulty with one of the issues. If anyone can help me, I'm grateful. For the code below, I need to justify the reason for the error. int main () { double x; x = 0.; printf(...
asked by 31.03.2017 / 05:08
0
answers

Function to dequeue in C

Personal I have to do a dequefile function. Get the user: -1 to dequeue an element or 2 to queue an element That is the user to queue has to enter option 2 and then enter the values and go adding so. If he wants to remove a value from the queue,...
asked by 21.03.2017 / 15:45
1
answer

Problem reading binary files!

I'm making a method for a code in C that adds an addition to the value of all books written to a binary file, however ... when I have more than 2 records, all on, ie the record 3,4 , 5 ... are rewritten with registry values 2 can someone help me...
asked by 13.03.2017 / 15:37
2
answers

Removal from list

I am with a program that registers trucks, loads and cities through a list. I was trying to remove the truck list, but when I remove it, the insertion still continues, as if I had not removed anything. What am I missing (is it the last function)...
asked by 06.03.2017 / 03:49
0
answers

Doubt when using variables [duplicate]

#include <stdio.h> main() { float valor; printf("..."); scanf("%f", &valor); printf("%0.2f", valor); } In scanf I should reference the pointer (memory space), since in printf this reference is not valid. What is t...
asked by 17.03.2017 / 17:29
2
answers

Pointer returning memory value

Well, good night, I ask you to guide me about my problem. Next, I'm developing a college assignment where I store and display the sorting results of various algorithms, such as comparisons, exchanges, and time. I have everything ready and writ...
asked by 13.03.2017 / 03:23