Questions tagged as 'c++'

1
answer

Mutable data member in C ++

Good morning everyone, to see if you remove the doubt. A constant function in theory is only used with const data members that do not modify the object, that is, this function will access a const data member but as I am looking at it, when we...
asked by 11.01.2018 / 23:37
4
answers

Find the last element of the array

Good evening people, I have a weird problem. Create a function to find the last element of an array, and I'm over it, I do not understand why int ultimo_elem (int x[]){ int contador = 0; while (x[contador]){ contador += 1; } return contado...
asked by 08.10.2017 / 02:14
3
answers

Dually linked lists do not print well

I am studying data structure in c ++, but I get to the moment where my list is not being printed correctly, in the first option, which is "Insert ()", only the first element of my list is printed, and in the second option that is "Fine ()" only...
asked by 23.10.2017 / 01:11
1
answer

Doubt in data structure Batteries

I have a question with exercise of batteries that I found, in this exercise, it looks for how many times a letter is repeated and also returns the number of letters that are in an even position. I have several doubts, one of them is in this p...
asked by 20.07.2017 / 22:06
2
answers

A question about how to read the strings in c ++

At the moment I was making a double linked list and when I started to try it I had a problem when reading the strings , I could not do that in the temp->nombre section I could read the line break, example if I wanted to put a nam...
asked by 21.08.2017 / 23:53
2
answers

A simple program in C ++ is locked in the third variable

I try to create a program in C ++ to calculate a profit with certain taxes , and for some reason the program breaks when it reads the third variable. How do I solve this problem? #include <stdio.h> #include <windows.h> using na...
asked by 17.05.2017 / 00:43
3
answers

Show current date and time in C ++

I am using Visual Studio 2015 and I want to show the "date" and the "current time" in C ++, for this I am calling the functions: getLocalTime and getTimeFormat. I have this code inside the main: printf(GetLocalTime); printf(GetTimeFormat);...
asked by 05.11.2016 / 17:21
1
answer

Because when I use cin inside a for there is no pause?

Hi, I've put a cin in a for so that I go asking for information but when I do it, it does everything for me, for example: When should I ask for one for one. Part of the code: int entradas,t; cout << "Introduce el numero de entr...
asked by 11.03.2017 / 13:21
1
answer

How does a template work in C ++?

I am in a computer engineering and this semester we have a subject called data structure (we give it in C ++). A few weeks ago they presented us the first practice on TADs and everything quite simple until in practice you are asked to impleme...
asked by 09.03.2017 / 07:14
2
answers

Get Date and time to send to a struct type variable in c ++

Best regards, I have a question, I appreciate your kind support: using namespace std; int main(int argc, char *argv[]) { //Fecha basado en el sistema actual de Sistema operativo time_t now= time(0); // captura fecga y hora actual tm *time =...
asked by 23.12.2017 / 02:17