Questions tagged as 'c++11'

1
answer

Function overload in C ++ passing arguments by value or by reference (Function Overloading)

Assuming we have this example of functions in C ++ void foo(int x) { std::cout << "foo(int)" << std::endl; } void foo(int& x) { std::cout << "foo(int &)" << std::endl; } Is there a possibility to different...
asked by 15.08.2016 / 13:26
1
answer

Array of objects with the class 'vector'

I wanted to know how you could create an array of objects with the vector class and also call the constructor method of each vector object (array). What I have done so far is this: #include<iostream> #include<vector> using names...
asked by 16.06.2018 / 02:18
1
answer

What is the proper way to manage multiple possibilities?

Each possibility has an answer. I know it should be done with switch / case , but I understand that it only works with constants, and what I use is a variable, right? I tried to use it and it gave me syntax errors. What I have do...
asked by 09.03.2018 / 16:38
1
answer

Makefile does not find .hpp

I have 2 folders in my project, 1 called Builds containing the Makefile and a test program (test-P0-console.cpp) and another called P0 with the date and string classes (date.hpp / cpp and string. hpp / cpp). The test-P0-console.cpp file includes...
asked by 17.03.2017 / 18:20
3
answers

Free memory of a variable that is pointer (doubt of nullptr)

I have a code that does the following: look for a student because of his id, I have a student arrangement: vector<Estudiante *> alumnos; and I do the search by means of a function that contains a cycle, which is the following:...
asked by 17.03.2017 / 04:25
1
answer

pointer not initialized when calling the constructor

I'm learning c ++ concretely the 2011 standard but I can use any standard from this, my problem is that when I call car () inside the second constructor it returns the data pointer without initializing. How can I fix it and why does this happen...
asked by 05.11.2018 / 22:46
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
2
answers

Call template builder in non-template class from daughter class

I'm doing a wrapper in C ++ for a C library ( libuv , in case there is curiosity). To keep the code as portable as possible, I am using pointers at the original struct . Each type of struct has its own initialization fun...
asked by 05.11.2017 / 09:32
1
answer

Doubt with Nested Cycle Exercise C ++

Good afternoon, in the following exercise, if I want to serve two people for example, when asking for the first data and what you are going to buy, you do not throw the invoice, but you throw it with the last one or this case In the latter case,...
asked by 08.04.2017 / 20:08
1
answer

Template error: invalid use of incomplete type

I found this on the Internet: #include <utility> #include <type_traits> namespace details { template< typename F, typename Tuple, bool Done, int Total, int... N > struct call_impl { static void call( F f, Tuple &&...
asked by 28.02.2018 / 14:56