Search:

Type: Posts; User: nimitzhunter

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds; generated 59 minute(s) ago.

  1. you're right, eofbit is set and calling ss.clear...

    you're right, eofbit is set and calling ss.clear works. Could you how seekp got eof?
  2. stream seekp doesn't work with trailing space

    I have this function to double a string. It puts a string into a stringstream and uses seekp to replace the old value with new value.



    std::string double_str(const std::string & input,...
  3. Replies
    1
    Views
    463

    Convert string_iterator to string

    I have a piece of code that is converting Roman Numerals to int.



    int RomanToInt(const string & Roms){
    if (Roms.size() == 0)
    return 0;

    unordered_map<string,int> Rom_Map =...
  4. Replies
    4
    Views
    627

    Could you explain why that needs another...

    Could you explain why that needs another parentheses pair?
  5. Replies
    4
    Views
    627

    compiler-time checker question.

    I have this piece of code from the book "Modern C++ Design" that checks for compile-time error. When i tried to compile it, i get the error "invalid application of sizeof to function type".

    Could...
  6. Replies
    2
    Views
    581

    is_pointer trait question.

    I came upon this sample code which the author said that std::is_pointer<T>::value always evaluate to false. The author didn't explain why this doesn't work and I haven't been able to find an...
  7. Replies
    2
    Views
    916

    Thanks for clarifying. I misunderstood the...

    Thanks for clarifying. I misunderstood the purpose of mutable. I thought that using mutable would allow me to modify the variable outside of the lambda scope without having to pass the references.
  8. Replies
    2
    Views
    916

    c++11 lambda question

    I would like some clarification on lambda.

    In the code below, I thought that using "mutable" will let me modify the captured variables. But the lambda function f2() doesn't seem to work that...
  9. Replies
    24
    Views
    3,184

    You need multimap to have multiple mappings for...

    You need multimap to have multiple mappings for Carr.

    I think mutimap::find needs the spelling of the key to be exact, so that won't help you.

    Instead, you can iterate through each element of...
  10. So it's really not safe to use when the lengths...

    So it's really not safe to use when the lengths are mismatched?
  11. Help with functions with 2 ranges

    I read the possible implementation of is_permutation from <algorithm> and got a bit confused about the handling of the second range.



    template <class InputIterator1, class InputIterator2>
    ...
  12. Replies
    11
    Views
    1,248

    I couldn't figure out head or tail with that...

    I couldn't figure out head or tail with that mess. I just rewrote the whole thing with an array. at least it worked.

    thank you everyone for your input.



    #include <iostream>


    using...
  13. Replies
    11
    Views
    1,248

    calculate 100! bug.

    Hi,
    i'm trying to calculate 100! for a project Euler problem. However, i ran into an issue while testing. The program does a correct calculation of 14! when i check the answer against google...
  14. Replies
    23
    Views
    1,363

    take " ofstream a_file("test.txt",ios::app);"...

    take " ofstream a_file("test.txt",ios::app);" outside the loop. you only need to open a file once. Remember to close it with a_file.closed();



    question[200]

    you're trying to access the 201st...
  15. Replies
    1
    Views
    620

    for(int j = 0; j

    for(int j = 0; j<5;++j) //fill up the Winning Digits
    WinningDigits;

    "i" was not declared in the for loop scope, switch it to "j".



    cout<<"DISPLAY RESULT:"<<end;

    there is no "end" in the...
  16. Replies
    35
    Views
    2,112

    if (userChoice == 1) { ...

    if (userChoice == 1)
    {
    BankAccount::makeDeposit(savings);
    }
    if (userChoice == 2)
    {
    BankAccount::makeWithdraw(savings);
    }

    can you change these...
  17. Replies
    35
    Views
    2,112

    C++ code - 199 lines - codepad...

    C++ code - 199 lines - codepad
  18. Replies
    35
    Views
    2,112

    if (userChoice == 1) { ...

    if (userChoice == 1)
    {
    BankAccount::makeDeposit(savings);
    }
    if (userChoice == 2)
    {
    BankAccount::makeWithdraw(savings);
    }
  19. Replies
    35
    Views
    2,112

    int main() { return 0; } two main functions...

    int main()
    {
    return 0;
    }

    two main functions and you compile without a problem?
  20. Replies
    35
    Views
    2,112

    void BankAccount::computeInterest() { ...

    void BankAccount::computeInterest()
    {
    interest = interestRate(balance);<---- interstRate is not a function, it's a variable.
    balance += interest;
    }
  21. Replies
    11
    Views
    789

    First, n was never initialized. so array[n - *]...

    First, n was never initialized. so array[n - *] is undefined.
    Second, "if (Move = array[n])", you're assigning, not comparing.

    you will need something like this:


    for ( int i =0 ; i <...
  22. Replies
    3
    Views
    734

    you're replacing a[2] with a[3], where a[2] =...

    you're replacing a[2] with a[3], where a[2] = a[3] = 4, so it seems like the 4 is not going anywhere. Then the code replace a[3] with a[4] which replicate the "5" in a[4] and give the "55" in the...
  23. Replies
    7
    Views
    8,037

    sign up for an account on github.com ( or not) ...

    sign up for an account on github.com ( or not) and clone the linux kernel. Proceed to have tons of fun.

    Edit: save you the trouble: https://github.com/torvalds/linux
  24. Replies
    9
    Views
    1,395

    trying to compile yours program. where is ...

    trying to compile yours program. where is "prototypes.h"?
  25. Replies
    38
    Views
    5,144

    your print_house function also messes up the...

    your print_house function also messes up the array.


    printf("| \\ Pod %c _ | |\n", Room_x[7]);

    Room_x[7] doesn't exist; it's whatever value exists...
Results 1 to 25 of 497
Page 1 of 20 1 2 3 4