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

Search:

Type: Posts; User: leourb

Search: Search took 0.01 seconds.

  1. Replies
    13
    Views
    8,050

    Re: [RESOLVED] Wrong output with pointers

    Thank you very much 2kaud, really! I have a very performant code now and I learnt something new, thanks!!
  2. Replies
    13
    Views
    8,050

    Re: [RESOLVED] Wrong output with pointers

    Thanks for replying 2kaud! I have already implemented code with a check in length:


    int n = len(c);
    int m = len(p);
    if (n != m) error("Lenght of the two pointers mismatch.");


    I...
  3. Replies
    13
    Views
    8,050

    Re: [RESOLVED] Wrong output with pointers

    Thanks again to have let me think deeper about sir!
  4. Replies
    13
    Views
    8,050

    Re: [RESOLVED] Wrong output with pointers

    You are perfectly right sir and I agree with you! I have no rancors with std functions! :) As I partially mentioned it is an exercise in my C++ book, written by Bjarne Stroustrup, where he forbade us...
  5. Replies
    13
    Views
    8,050

    Re: Wrong output with pointers

    I have solved changing my bool function in something more verbose but more specific:



    bool is_palindrome(const char* c, const char* p)
    {
    int n = len(c);
    for (int i = 0; i < n; ++i)
    ...
  6. Replies
    13
    Views
    8,050

    Re: Wrong output with pointers

    Yep it is an homework. I have tried to debug it, checking scope by scope what is going on inside the code. I always try to avoid posting for help because of "no pain no gain"! But in this case I am...
  7. Replies
    13
    Views
    8,050

    [RESOLVED] Wrong output with pointers

    Hi everyone! I am trying to write a function that compares the original word with its reversed. My main problem, and I cannot figure out why, I am getting always a "false" return in a boolean...
  8. Replies
    3
    Views
    6,554

    Re: I cannot input enum class value

    I solved the issue!

    I have split out the helper function in two distinct, then in main() I have separated cin creating a specific object for Genre enum class. It works perfectly! Thank you anyway...
  9. Replies
    3
    Views
    6,554

    Re: I cannot input enum class value

    Do you mean this?


    ostream& operator<<(ostream& os, Book& n)
    {
    return os << "Title: " << n.f_title() << endl
    << "Author: " << n.f_author() << endl
    << "ISBN: " << n.f_isbn() << endl...
  10. Replies
    3
    Views
    6,554

    I cannot input enum class value

    I have defined a enum class:


    enum class Genre
    {
    fiction, nonfiction, periodical, biography, children
    };

    And another class:
Results 1 to 10 of 10





Click Here to Expand Forum to Full Width

Featured