Search:
Type: Posts; User: leourb
Search:
Search took 0.01 seconds.
-
August 16th, 2015, 06:00 PM
Thank you very much 2kaud, really! I have a very performant code now and I learnt something new, thanks!!
-
August 16th, 2015, 01:38 PM
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...
-
August 16th, 2015, 01:12 PM
Thanks again to have let me think deeper about sir!
-
August 16th, 2015, 01:08 PM
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...
-
August 16th, 2015, 12:58 PM
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)
...
-
August 16th, 2015, 12:43 PM
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...
-
August 16th, 2015, 11:28 AM
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...
-
July 28th, 2015, 03:18 AM
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...
-
July 28th, 2015, 02:55 AM
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...
-
July 27th, 2015, 01:05 PM
I have defined a enum class:
enum class Genre
{
fiction, nonfiction, periodical, biography, children
};
And another class:
|
Click Here to Expand Forum to Full Width
|