Posts by snortt • 141 points
4 posts
-
0
votes1
answer65
viewsQ: Initialize members of a structure, accessed via pointer, in the constructor of a C++ class
Imagine the class DateTime as follows: datetime.hpp: #ifndef DATETIME_HPP #define DATETIME_HPP #include <ctime> class DateTime { public: DateTime(); DateTime(int, int, int, int, int); private:…
-
10
votes5
answers13505
viewsA: Difference between Object and Instance
You have a class A that can be instantiated n times, generating a group of n objects of type Class A. If you take one of these objects individually, you are dealing with an instance of A. The fonts,…
-
4
votes2
answers1773
viewsA: How to make code include in Shell Script files
Hello. Complementing the excellent answer given, it is worth remembering that, in addition to source arquivo.sh you can also use . arquivo.sh If there is no bar in the.sh file name, Shell will…
-
0
votes1
answer1567
viewsA: How to compare, remove equals, etc elements of two vectors in java?
Hello, see if this helps you. It’s a simple code, the way you put it. I just made a loop to read the entries (fewer lines of code) and, after printing the two vectors, I did the basic operations…