Search:

Type: Posts; User: ComputerPhreak

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    1,105

    You can't really call a function by its name as...

    You can't really call a function by its name as the function names are discarded in the final executable (unless you leave the debug symbols in)... so I'd just use a if statement block to compare the...
  2. Replies
    9
    Views
    8,970

    My solution: int bitMask(int highbit, int...

    My solution:



    int bitMask(int highbit, int lowbit)
    {
    unsigned int i = 0;
    i = ~i;
    i <<= 32 - ((highbit-lowbit) + 1);
    i >>= 32 - (highbit + 1);
  3. Replies
    8
    Views
    2,134

    Err, my bad, the constructor is actually ...

    Err, my bad, the constructor is actually


    string( size_type length, const char& ch );

    http://www.cppreference.com/cppstring/string_constructors.html
    In this case the second argument could be...
  4. Replies
    8
    Views
    1,402

    Google for QT, wxWidgets, or GTK.

    Google for QT, wxWidgets, or GTK.
  5. Replies
    8
    Views
    2,134

    That is exactly what you would do. Also, most...

    That is exactly what you would do. Also, most implementations (i know SGI's does) of std::string reserve an extra byte when realloc'ing for the null terminator should the c_str() member function be...
  6. Typo's:

    Typo's:
  7. Replies
    5
    Views
    2,820

    That is incorrect. clock() may return 0 if you...

    That is incorrect. clock() may return 0 if you call it at the begining of your program, since it returns the amount of ticks since the program has started, but it certainly won't return 0 otherwise:...
  8. I suggest doing the following instead of using...

    I suggest doing the following instead of using qsort:
    Overload operator< on your structure, then use the stl's std::sort() to sort the list of your structures. I can pretty much guarantee you that...
  9. Replies
    18
    Views
    2,645

    Actually that is incorrect, member functions are...

    Actually that is incorrect, member functions are not stored in instances of classes, the member function is actually turned into a function that takes a pointer to the object as a parameter.


    ...
  10. Replies
    2
    Views
    7,788

    for loops don't typically have semicolons at the...

    for loops don't typically have semicolons at the end. Remove it and the code will function as you intended.
Results 1 to 10 of 10