In fact, I hadn’t changed the name of the variable – I used “messageFromPC”, which is the same name as that used by Robin in his tutorial. Moreover, in my first post, I did mention where I had put the variable (inside the void loop), although that reference perhaps was still quite inaccurate. That said, I understand now that I should’ve posted my code anyway (so, sorry, my bad!).
Regarding the mistake I made, I must acknowledge that I don’t fully understand what the problem was, for the simple reason that I haven't thoroughly understood Robin’s tutorial yet (I have very basic programming skills).
I started my project using String class, indexOf() function, and substring() function. That way, I was able to read and parse strings without any problems, except for the fact that I got the RAM running low very quickly (I’m using UNO). Then, I came across Robin's tutorial, and I learnt that using String class isn't the best choice, for a number of (good) reasons. I thus tried to learn this other method and implement it in my own code. As I wrote, however, I don't fully understand its logic (not yet).
As far as I understand it, char class stores characters as numerical values, based on ASCII encoding. Besides, a null terminator (i.e., “\0”) is added to the end of the array of characters received (as UKHeliBob well pointed out). Hence, if you want to make use of the plain text sent through the serial, you need a function that turns these values (those stored in char) into actual characters. I guess, that’s what strcmp() in UKHeliBob’s example does.
In this regard, I’ve just read that strcmp() function compares two C strings, starting from the first character of each of them, so continuing until either the pairs of characters of the two strings being compared differ from each other or the null terminator is reached. So, in the current version of my code, UKHeliBob’s fix compares the variable named messageFromPC to the text “hi there”, by means of strcmp(), returning 0 if there’s a complete match.
I hope I’ve better understood the nature of the problem and learnt something. Thank you UKHeliBob and TheMemberFormerlyKnownAsAWOL for your help.