Questions tagged as 'iterator'

1
answer

C ++ Iterator while jumping the reading of cin.getline

I'm starting in C ++, during some tests I noticed that after the second iteration of while the command cin.getline was not read displaying the line after it. I do not understand what happens. Here is the code: #include <iostream> #includ...
asked by 24.06.2017 / 01:33
2
answers

Loop in hour interval

I need to walk through a time slot to set up a schedule grid. Example: 8:00 AM to 10:00 AM, adding 30 minutes. Forming a grid like this: 8 o'clock 08:30 09:00 09:30 10:00 I'm trying like this: GregorianCalendar gc = new GregorianCalenda...
asked by 06.09.2016 / 15:55
1
answer

DoublyLList C ++ // Insert value in position index (with iterator)

My function to insert is correct, but I'm having memory leak because when I debugged, temp->prev->prev was pointing to nullptr instead of pointing to the rest of the list when it has 3+ elements. Note: The 'address' of the...
asked by 08.03.2016 / 00:52
1
answer

Problem with Iterator Map C ++ [duplicate]

The program for a URI exercise hangs (as in infinite loop) when the input (double) is different from an integer or a decimal number that is not something with a middle (eg 55.5). I have tried to modify the code in several ways, but it seems th...
asked by 20.09.2015 / 09:08
2
answers

Sum of Integer Numbers in a txt File

I have two txt files that contain only numbers (number per line), so I want to add line 1 + line 1 so in succession to the last line of each file. Each file has the same line number. ** In this code I can only print the first sum of the first...
asked by 18.02.2018 / 17:23