Questions tagged as 'c++'

1
answer

Dynamic Pointer Allocation in C ++

I need to create a protection routine in the removal function. Why did you make an error removing the last item? The function: // Remover o primeiro cliente void cadRemover(){ lista=ini; // Volta ao início aux = lista; // Copia o 1º p...
asked by 09.08.2014 / 14:12
1
answer

Count how many columns there are in a CSV file with C ++

I am doing a project for an electronic ballot box, and for this I need to read a csv file where there is information about each candidate. As this csv file has a lot of information that is not relevant, I decide to use only certain columns of...
asked by 08.09.2018 / 05:55
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

Remove item from a simply linked list

I'm having trouble removing an item by the value of a simply linked list. I'm doing this: class No{ public: int dado; No *next; No(int item, No *ptr= NULL){ dado=item; next=ptr; } }; class Lista{ public...
asked by 16.03.2015 / 16:57
3
answers

Accessing a pixel in SFML

I'm developing a project where I should access a pixel from an image and put them in a new RGB array, for this I am using the SFML library, my difficulty is in logic, I know that a pixel is the smallest point of an image and this library gives m...
asked by 09.05.2014 / 18:46
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

Why does a parameter have two const's in its declaration?

I'm reading the tutorials on the OpenCV lib site and during reading I saw the declaration of a function with a variable in a format I've never seen. I wanted to know what it means, declare the variable this way. I will post only the prototype of...
asked by 19.01.2017 / 01:44
1
answer

How to measure times in multi-threaded programs in C

I'm doing a multi threaded work in c, and I need to calculate the time of a certain part of the program, does anyone have any idea how I can do this?     
asked by 26.10.2017 / 15:56
1
answer

How do I get the time in seconds of a date in the string format?

I know that the time(0) function returns me the seconds from the first of January 1970, in which case the user would enter a date (dd-mm-yyyy or in any format due to system limitation) check which date is the oldest. Are there librari...
asked by 15.11.2016 / 21:23