Search:

Type: Posts; User: Darryl

Page 1 of 20 1 2 3 4

Search: Search took 0.03 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,360

    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
    12,766

    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
    12,766

    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
    12,766

    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
    11,137

    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,656

    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
    14,518

    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
    14,518

    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,341

    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
    5,941

    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,860

    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,526

    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
    13,253

    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,928

    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
    2,156

    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
    2,156

    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
    2,156

    #include class Base { public:...

    #include <iostream>

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

    by Darryl
    Replies
    19
    Views
    2,156

    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,386

    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,386

    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,250

    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,334

    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,334

    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