I have a question regarding pointers/references, I couldn't find much information about, so, having this method declaration (C++):
void RequestParser::parseRequest(const char * request)
When I want to use this method, I can call it like this:
requestParser.parseRequest(buffer);
So, going back to the definition the parameter expects a pointer (const char * request), why am I allowed to pass buffer without the reference, this way:
requestParser.parseRequest(&buffer);
This should be the correct way, right? Maybe there is some magic going on behind the scenes, like this:
void RequestParser::parseRequest(const char request[])
I know that you can't pass array as value (at least char arrays), so this is only syntactic sugar for this:
void RequestParser::parseRequest(const char * request)
What am I misunderstanding?