CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: babaliaris

Page 1 of 6 1 2 3 4

Search: Search took 0.24 seconds; generated 13 minute(s) ago.

  1. Static Linking A -> B -> Program, Program must also be linked against A???

    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...
  2. Re: How to generate a condition (true or false) based on possibilities?

    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...
  3. How to generate a condition (true or false) based on possibilities?

    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...
  4. Re: Force a friend outside of class declaration?

    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!
  5. Force a friend outside of class declaration?

    Is it possible to force a class to have a friend class or friend function outside of this class declaration?

    For example



    class MyClass
    {
    . . .
  6. Re: Do header files with implementation work in a precompiled header?

    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...
  7. Re: Do header files with implementation work in a precompiled header?

    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...
  8. Do header files with implementation work in a precompiled header?

    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)
  9. Code abstraction using the preprocessor vs interfaces?

    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...
  10. Re: Casting references VS Casting the mem address of that reference?

    LOL, I thought dynamic cast would fail on a downcast and work only for upcasts. Is it the other way around?
  11. Casting references VS Casting the mem address of that reference?

    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:
  12. Re: Copy constructor does not get called when assigning reference to a non reference

    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...
  13. [RESOLVED] Copy constructor does not get called when assigning reference to a non reference var!

    class Dispatcher
    {

    //Dispatcher callback.
    template<typename T>
    using DispatchCallback = std::function<void(T&)>;



    public:
  14. Re: Why does this simple file read method does not work?

    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 ...
  15. Re: Why does this simple file read method does not work?

    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...
  16. Why does this simple file read method does not work?

    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 |...
  17. Re: MBR bootloader segments initialization problem!

    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...
  18. [RESOLVED] MBR bootloader segments initialization problem!

    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...
  19. Re: [vsCode and gdb]: Breakpoints don't work with macros?

    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.
  20. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    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...
  21. Re: [vsCode and gdb]: Breakpoints don't work with macros?

    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...
  22. [vsCode and gdb]: Breakpoints don't work with macros?

    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>...
  23. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    This is my current implementation and it works quite well.



    #ifndef VMPS_LINKEDLIST_HPP
    #define VMPS_LINKEDLIST_HPP
    #include <iostream>

    namespace VMPS
    {
  24. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    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....
  25. Re: Templates: Generic Linked List, I stuck at returning type in template functions.

    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...
Results 1 to 25 of 130
Page 1 of 6 1 2 3 4





Click Here to Expand Forum to Full Width

Featured