Search:

Type: Posts; User: Darryl

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Concerning the wrapper idea. A better thought...

    Concerning the wrapper idea. A better thought might be inheritance. Generally it's not a good idea to derive a class from the std containers because they don't have virtual destructors.
    ...
  2. Thread: Beginner Error

    by Darryl
    Replies
    10
    Views
    1,057

    There is another mistake that was missed. Your...

    There is another mistake that was missed. Your nested elses are wrong. Should follow this pattern...
    if
    else if
    else

    you can have multiple else if, but only one else.
  3. Replies
    20
    Views
    8,042

    I guess it's easy to make your algorithm optimal...

    I guess it's easy to make your algorithm optimal when you first set up all the confining conditions.

    My linear search routine is always faster when the item searched for is in the first few...
  4. Replies
    20
    Views
    8,042

    Not really, it's no better than a sequential...

    Not really, it's no better than a sequential search, which is way easier to program. Actually it's probably worse due to overhead in maintaining the "splits" of the binary search when the value...
  5. Replies
    20
    Views
    8,042

    To reiterate what matsp said: You can't do a...

    To reiterate what matsp said:

    You can't do a binary search unless the array is sorted. If the array is sorted (assuming in ascending order) the max value is the last value in the array.

    If the...
  6. Replies
    13
    Views
    9,200

    I'd like to see the car.Read() function, my guess...

    I'd like to see the car.Read() function, my guess is that it is returning false and so fleet.push_back is never getting called.

    Even if you you don't have a custom copy constructor(but needed...
  7. Replies
    19
    Views
    2,111

    To continue your analogy: Worse is that...

    To continue your analogy:

    Worse is that another 'new' may have built a new house at that address, and now deleting ptr2 may demolish another object's house creating a very hard to diagnose/debug...
  8. Thread: Factorial

    by Darryl
    Replies
    27
    Views
    12,490

    oh man I thought I had till end of day today... I...

    oh man I thought I had till end of day today... I was just about to submit mine...oh well... I didn't get to finish it the way I wanted anyway. Mine was complete but I wanted to switch to Karatsuba...
  9. Thread: Factorial

    by Darryl
    Replies
    27
    Views
    12,490

    Hey, I am interested too, I am just now seeing...

    Hey, I am interested too, I am just now seeing this, but I already have a bignum library I wrote so it won't take much to throw together an entry.
  10. Replies
    5
    Views
    1,153

    Or you can get the 2008 express edition which...

    Or you can get the 2008 express edition which includes the SDK.
  11. Thread: sudoku

    by Darryl
    Replies
    22
    Views
    3,949

    You are missing an important rule... Each 3x3...

    You are missing an important rule...

    Each 3x3 sub grid should contain all elements 1-9

    otherwise, this would be valid, shift position by 1 each row like:

    123456789
    234567891
    345678912...
  12. Replies
    2
    Views
    4,300

    I've never use ado with Excel but with Access...

    I've never use ado with Excel but with Access plenty of times, which I imagine is similar. Anyway, [removed], (though I am fairly new to c# ) but anyway here is a good example to look at check this...
  13. Thread: 1-800-contest

    by Darryl
    Replies
    17
    Views
    3,065

    The lack of vowels corresponding to the numbers...

    The lack of vowels corresponding to the numbers 9-7-5, makes it a bit tough to come up with anything. At first glance I thought you were trying to say "1-800-Good-Bye" , but that clearly does not...
  14. Thread: Brute Force

    by Darryl
    Replies
    6
    Views
    10,867

    No, I think you got it wrong, I found this...

    No, I think you got it wrong, I found this definition for
    brute-force: http://cplus.about.com/od/glossar1/g/bruteforce.htm
    Hard Coding: http://en.wikipedia.org/wiki/Hard_coding
  15. Replies
    4
    Views
    1,746

    Pass NULL or 0 to the functions FindWindow and...

    Pass NULL or 0 to the functions FindWindow and FindWindowEx, not an empty string ("")
  16. Off hand without seeing the code, I would guess,...

    Off hand without seeing the code, I would guess, your program is not ending... this is common mistake in beginners windows program. If you don't create a handler to handle WM_DESTROY, more...
  17. Thread: Inheritance

    by Darryl
    Replies
    19
    Views
    1,586

    In this case, the constructors are needed, and...

    In this case, the constructors are needed, and you must pass the value to the base constructor to initialize it, for example



    ReverseString::ReverseString(const ReverseString &rhs) : String...
  18. Thread: Inheritance

    by Darryl
    Replies
    19
    Views
    1,586

    Each class has it's own constructor, even if only...

    Each class has it's own constructor, even if only it is the default one created by the compiler.

    as for methods(functions), You only need to define it if you want different behavior an then it...
  19. Thread: Inheritance

    by Darryl
    Replies
    19
    Views
    1,586

    #include class Base { public:...

    #include <iostream>

    class Base
    {
    public:
    int get_x()
    {
    return x;
    }
  20. Thread: Inheritance

    by Darryl
    Replies
    19
    Views
    1,586

    Directly? You can't. Indirectly, through...

    Directly? You can't.

    Indirectly, through public/protected member functions provided by the base class
  21. Replies
    6
    Views
    2,093

    A. Assuming FindOneOf() can take a CString as...

    A. Assuming FindOneOf() can take a CString as it's parameter.
    B. Assuming from your statement CString has a conversion constructor that takes a const char*

    FindOneOf( "some const char*") should...
  22. Replies
    6
    Views
    2,093

    while on the surface this seems like the solution...

    while on the surface this seems like the solution and probably is, but looking deeper I'd have to question MFC and CString.

    If CString takes an Ansi string during construction and successfully...
  23. Replies
    6
    Views
    1,104

    unsigned char ks64_encode(unsigned char...

    unsigned char ks64_encode(unsigned char *dest,unsigned char raw )

    looks like a regular function to me, but since in the header it's a member function, I'd suggest this change

    unsigned char...
  24. Replies
    7
    Views
    1,075

    We know WHAT you are trying to do, we just don't...

    We know WHAT you are trying to do, we just don't know WHAT doesn't work.

    1. Does it compile?
    2. Does it give any runtime errors?
    3. If it runs, what's the output? Is it what you expected? No?...
  25. Replies
    7
    Views
    1,075

    What doesn't work? The program? Opening a file?...

    What doesn't work? The program? Opening a file?

    Looking at the code, I would question whether it could compile without including "tchar.h". Other than that the code looks ok. So if you are...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4