Search:
Type: Posts; User: babaliaris
Search:
Search took 0.05 seconds.
-
February 19th, 2022, 03:01 PM
Hello!
I thought I knew how static linking works, but I guess I do not...
I made 2 (A and B) libraries in my project and a final program.
A and B are both static libraries.
B links A and...
-
January 14th, 2021, 08:01 AM
I'm sorry I might have not explained the problem clearly. What I'm trying to do is something like those random balls pick up where you spin them in a bowl and then you choose one randomly.
Now...
-
January 13th, 2021, 09:34 AM
Hello!
10 years into programming and I never ever had to use possibilities in conditional statements. Right now, I'm making a video game and I want my enemy to choose how to roam in the map based...
-
September 28th, 2020, 12:55 AM
Yeap this seems to be the only solution. I checked googletest to see how they do it, and their implementation is excactly like your answer!
Thank you!
-
September 27th, 2020, 09:22 AM
Is it possible to force a class to have a friend class or friend function outside of this class declaration?
For example
class MyClass
{
. . .
-
September 11th, 2020, 12:42 PM
I have the option Use(/Yu) in the precompiled header options.
Precompiled header file : pch.h
Precompiled header source file : <full_path_to>pch.cpp
In the include direcotries of the...
-
September 11th, 2020, 10:46 AM
Yes, I know that! The thing is that I'm using some quite big header-only libraries and every time I change my code it takes 1 minute to compile.
And I'm talking about the beginning of a project...
-
September 11th, 2020, 06:19 AM
Let's suppose we have this header file:
People.h
class People
{
public:
People(const std::string &name, int age)
: m_name(name), m_age(age)
-
September 9th, 2020, 02:36 AM
Let's assume you're building a game and you want to have a Window class which it's implementation differs on different platforms.
I have seen two ways to achieve this. One is by wrapping each...
-
September 7th, 2020, 12:55 AM
LOL, I thought dynamic cast would fail on a downcast and work only for upcasts. Is it the other way around?
-
September 6th, 2020, 02:42 AM
If you want to cast a reference you usually do this:
Subclass &myref = (Subclass&)base_class_object_ref;
But I have also seen people doing this:
-
September 5th, 2020, 06:21 AM
Never mind my mistake... The reason wasn't the copy constructor. In the Dispatcher(Event &e) I was passing an instance of MouseMovedEvent which is a subclass of Event.
But because inside the...
-
September 5th, 2020, 06:12 AM
class Dispatcher
{
//Dispatcher callback.
template<typename T>
using DispatchCallback = std::function<void(T&)>;
public:
-
August 28th, 2020, 10:39 AM
Haha, I just figured it out! Yeah, that was the problem! I was trying to std::cout << returned_string << std::endl . I thought that the result would display zero but apparently it does not work ...
-
August 28th, 2020, 10:25 AM
I did it but the issue was not fixed...
By the way if I remove the line:
//Set exception mask for file stream.
file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
then this...
-
August 28th, 2020, 07:35 AM
std::string Program::readFile(const char* path)
{
//Variables.
std::ifstream file;
std::string content;
//Set exception mask for file stream.
file.exceptions(std::ifstream::failbit |...
-
August 11th, 2020, 10:58 AM
I figured it out.
The problem is that when I'm referencing a memory address like this:
by default, the data segment register is being used to do the segment - offset calculation. For...
-
August 10th, 2020, 05:36 PM
I'm compiling using
nasm -f bin
I'm running the bootloader using
qemu-system-x86_64
I have 2 versions of the same code with a slight change to the second version. First version uses the [org...
-
September 9th, 2019, 02:47 AM
I'm already using others, like google test. Just for fun and knowledge I'm creating my own. Google test also uses global variables to achieve that.
-
September 8th, 2019, 07:06 AM
I fixed the remove method. (Yes I wasn't handling the disconnection of the deleted node from the list).
Well about the for loop, it works if the size does not change. if you do something like...
-
September 8th, 2019, 06:35 AM
I understand now. Well, I'm trying to figure another implementation which googletest follows and I think it will work.
#include <iostream>
#include <ctime>
#include <vector>
#define...
-
September 8th, 2019, 05:30 AM
Hello!
I made a unit testing framework and for the first time, I noticed that breakpoints won't work with macros. This is how my tests look like:
main.cpp
#include <VampTest/VampTest.h>...
-
September 7th, 2019, 04:15 PM
This is my current implementation and it works quite well.
#ifndef VMPS_LINKEDLIST_HPP
#define VMPS_LINKEDLIST_HPP
#include <iostream>
namespace VMPS
{
-
September 7th, 2019, 02:16 PM
I think I get the idea now. Tell me if I understood it correctly :D
Something like this (code did not tested):
User's Code:
//The other must be the same type as the search method template....
-
September 7th, 2019, 01:40 PM
source of the above quote
Ok, I searched c++ iterators on the internet and found this. I'm new to STL and I didn't know that. Thank you for pointing me in the right direction. I'm off my way...
|
Click Here to Expand Forum to Full Width
|