Questions tagged as 'c'

1
answer

Parsing columns of numbers from a CSV file in C

Hello, Good Night I have a simple .CSV file, containing only two columns, separated by a comma and the new line, as an example: 0.001,-9.623 0.098,2.540 1.000,-1.002 And you need to separate them preferably in two vectors, or in an array...
asked by 19.03.2018 / 02:23
1
answer

Program has memory garbage 2 in C

This is the program question: Make a program, using the function below, that displays the highest salary of each department in a company and how many employees earn the highest salary in the department. For each department, the program should...
asked by 15.05.2018 / 23:52
1
answer

Floating point exception (core dumped)

This code is giving the error Floating point exception (core dumped) , it's just a piece of programming in c, but this error occurs after printf("\nO Total de apostas foram:%d\n", taposta); in main , so the error is inside the...
asked by 13.12.2014 / 17:04
2
answers

Doubt about array size

I have a question regarding array, for example, if I have 2 arrays of size 9 and to print the values of both is normal the input 9 get the value 0 of the next array?, this is another test, I know the maximum is 8? Code sample: struct stType...
asked by 15.01.2018 / 17:35
1
answer

How to check if two vectors have equal values quickly

The element number reaches 100000 and I have to compare it with another vector of 100000, how can I do this with a very high gain gain? How I'm comparing vectors for(i = 0; i < teste; i++) { for(j = 0; j < teste; j++) {...
asked by 30.05.2018 / 04:22
2
answers

Loop Compile Error For

I'm doing a program that asks how many notes the user will type and then enters a 'for' loop asking what the notes are to type. The notes are stored in an array and finally the average is calculated. #include <iostream> using namespace...
asked by 14.12.2017 / 00:15
2
answers

How to get the operating system time in nanoseconds or milliseconds using Qt Creator?

How can I get system time in nanoseconds or milliseconds in C++ using Qt Creator ? For example, in% use% use: long tempoInicial = System.nanoTime(); treinaRNAEpocas(10000); long tempoFinal = System.nanoTime(); long tempoDecorri...
asked by 20.03.2015 / 05:46
1
answer

Return from Struct in C

Hello, I am trying to return a struct from a function when it is called in main. I have done the whole function and define in the end two elements that are calculated in the function: int mult[100]; char** elemfim = (char**)malloc(100 * sizeof...
asked by 13.12.2017 / 12:29
1
answer

Is it possible to initialize a structure partially indicating the members?

In several languages it is possible to initialize a struct , or class, indicating which members want to put some value: var obj = new Tipo { b = 1, e = "x" }; In C we can initialize the members in order: Tipo obj = { 0, 1, 2, 'c', "...
asked by 17.01.2017 / 11:34
1
answer

Linked list, union of structures

I'm having a hard time joining two structures in the same linked list, I've never worked with generic lists or even linked two structures together in one activity, I have the following structures: struct Patio { char iden_patio; int ca...
asked by 30.03.2017 / 03:29