I found some code online for a C++ Chat Server. And in the code below contains something I don't get
// Code for chat server
Asterisk after the
string means that it is a pointer to a
string object somewhere else in memory. Removing the asterisk changes the return type from the function:
string* buildPrompt(); // <-- Returns pointer to a string. string buildPrompt(); // <-- Returns an instance of a string.
I would recommend doing some basic reading on pointers in C++, they're pretty fundamental to the language once you advance from simple "Hello, World!" programs.