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

Search:

Type: Posts; User: treuss

Page 1 of 80 1 2 3 4

Search: Search took 0.12 seconds.

  1. Replies
    3
    Views
    821

    Re: Preparing for C++ job interviews

    My 2c:
    Understanding pointers, classes, objects and arrays are the very basic things. If you fail to show that you 100% understand those, you will fail the interview
    Hardly any company will want to...
  2. Replies
    3
    Views
    3,346

    Re: Assigning values to union in C++

    You need to decide, which part of your union you want to assign values to:

    EntryHeader entry;
    entry.uuid.ll = {0u, 4294967295u};
    entry.uuid.byte = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};...
  3. Replies
    4
    Views
    652

    Re: angle math question

    Your algorithm returns true for angle1 = 170 and angle2 = -170 (distance 20°) but false for angle1 = 10 and angle2 = -10 (also distance 20°). So I would say, your algorithm is flawed.
  4. Re: Passing a function pointer as template argument to a class

    Thanks Superbonzo!

    I was trying the same approach, i.e. using a generic class to wrap around the function(s) but always ended up with the same problem, i.e. how to pass the function as a template...
  5. Re: Correct syntax for for using getline with vectors?

    Correct syntax would be something like:
    while(! getdata.eof()) {
    string s;
    getline(getdata, s, ',');
    v_input.push_back(s);
    }
  6. [RESOLVED] Passing a function pointer as template argument to a class

    Hi all,

    I have in the past written code for templated functions where one function argument can be either a function pointer or a Functor. Works pretty straightforward.

    Now I am in a situation...
  7. Re: Any good resources deadling with simple file input?

    To make one thing clear: Your programm cannot know, where the "Tuesday" section starts without reading the file from beginning until it finds Tuesday. So to read only the Tuesday section, you have...
  8. Replies
    10
    Views
    1,097

    Re: Switch Output Error

    Nope, you won't get the program to print one of the strings "hourly", "monthly" or "weekly" unless you tell it to.

    An enum will internally be an integer, so everytime you write in your code hourly...
  9. Re: reading data character by character from text file

    Can be done, but why?

    Why not just read the floating values:

    std::ifstream input("test.txt");
    double d;
    while (input >> d) {
    std::cout << "Read " << d << "\n";
    }
  10. Replies
    5
    Views
    588

    Re: C++ Standard to Template Class

    void push(int)
    int pop();Why "int" if you want to push/pop objects of class C?
  11. Replies
    3
    Views
    3,233

    Re: pimpl class with pointer to base class

    D'oh! Knew it was something stupidly simple.

    Hmm, that's what I assumed and tried but it gave me "the pure virtual method called" error, so I thought I was truncating the derived classes to their...
  12. Replies
    3
    Views
    3,233

    pimpl class with pointer to base class

    I'm trying to implement a class hierarchy and a wrapper class with a pointer to the base class. The base class has operator< overloaded and the implementation makes use of virtual functions as some...
  13. Replies
    4
    Views
    6,103

    Re: template specialization for char arrays

    Thanks Superbonzo for both posts.

    Overloading indeed solves my problem, but iirc, combining overloading and template specialization causes some difficult to predict behaviour (depending on the...
  14. Replies
    6
    Views
    1,311

    Re: Comparing Images

    If your images are jpegs (or in a similar format), scaling might not be the only problem but also the lossy compression algorithm being used will likely have an even higher impact. Try opening a png...
  15. Replies
    4
    Views
    6,103

    template specialization for char arrays

    Hi,

    I'm trying to get template specializations working for char * as well as for char[]. I.e. in the following code the last test does not use the specialization and fails:

    #include <string>...
  16. Thread: make trouble

    by treuss
    Replies
    3
    Views
    641

    Re: make trouble

    If you look closely, you will see that the error message is actually coming from /bin/sh and the error reads:

    -spec: command not found
    So, some line in your make file evaluates to starting with...
  17. Re: How can I implement bidirectional communication between two processes?

    Check this post (from a long time ago). The example assumes though that your first program spawns the second one.
  18. Replies
    6
    Views
    5,779

    Re: pair vs tuple in uniform initialization

    Hi,

    the constructor tuple::tuple(P1, P2, ...PN) is explicit.


    std::tuple<std::string, std::string> b{"Richards","BCPL"};
    Here you are explicitly calling the constructor.

    ...
  19. Re: I need a crypter without control chars or nulls

    All advanced cryptology works on large (incredibly large) numbers. So the text you encrypt is interpreted as a bunch of bytes forming a large number and likewise the encrypted message is a large...
  20. Replies
    3
    Views
    780

    Re: Object defined recursively?

    If the object contains a body, an octant and 8 objects, each of them containing a body, an octant and 8 objects, each of them containing a body, an octant and 8 objects, each of them ..... I don't...
  21. Replies
    1
    Views
    1,082

    Re: theoretical limit on message queue sizes

    You can change the default message queue size in Linux by changing /proc/sys/kernel/msgmnb.

    Example:
    echo "4294967295" >/proc/sys/kernel/msgmnb
  22. Thread: typedef struc

    by treuss
    Replies
    4
    Views
    773

    Re: typedef struc

    This will not loop at all. It would have to compile first before looping.
  23. Replies
    2
    Views
    2,089

    Re: Inline failed in call to ...

    AFAIK, std::map does not declare a virtual destructor (in the implementation I have at hand, it does not declare a destructor at all). So publicly deriving a class (in this case mysql_map) from it is...
  24. Replies
    4
    Views
    1,301

    Re: How do I submit a gcc bug?

    In Bugzilla you certainly can attach files. It might be that you first need to submit the report though.

    Check some of the existing bugs: There's a "Create a new attachment" link.
    ...
  25. Replies
    2
    Views
    1,886

    Re: how to read an octal number?

    Read it into an unsigned char, then cast it to an unsigned int for output.
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4





Click Here to Expand Forum to Full Width

Featured