Post has attachment

BOOK: C++ Primer 5th Ed. Stanley B. Lippman

Hey everyone it's been a while I know. I've come to this problem that I don't quite understand. So I get that we are looking for the position and the number of occurrences. But that part about auto ret = s.size(); what's the point of that equaling s.size()?? I tried to think of every reason I could but I could not. s.size() stands for the size+1 pass the last index of the sentence. So let's say the sentence is 10 characters. Then ret = 11. Then the example repeats down the line with if(ret == s.size()), and this really throws me off. Why would you make a condition to where ret == 11? It makes no sense to me...

Btw, there are two scan photos...
2 Photos - View album

Anyone here in Fort Worth or Dallas who are coders? learning to code? or even interested in coding?

Reading up on the definition of overloading operators is actually extremely confusing! The book I'm reading currently has one paragraph about it. Its likely to have more to say about it in the later chapters but so far it only explains that overloading operators are simply just symbols like << and >> and everything used in strings, vectors and arrays can have different definitions depending on what context they are seen in. I hope the book explains this better in the later chapters...

Book: C++ Primer 5th edition Stanley Lippman Chapter 4: Overloading operators

I am currently reading a text book called C++ Primer 5th edition by Stanley Lippman. Its a pretty great book! I suggest if you are interested in C++, then by all means go for this book. It explains many things pretty well and has great examples. It's also pretty detailed. It's considered one of the best books to learn C++ according to Amazon reviews because it gets its students coding the right way. Meaning that it promotes good habits in when coding.

As of now, I am finishing up chapter 3: Strings, Vectors, and Arrays and moving on into chapter 4: Expressions!

Book: C++ Primer 5th edition Stanley Lippman Chapter 4
Wait while more posts are being loaded