So if I have this line of code below, it returns the error also shown below.
string beads = "example";
if (beads[0] == "w")
./beads.cpp:19:15: error: comparison between pointer and integer ('int' and 'const char *')
if (beads[0] == "w") {
~~~~~~~~ ^ ~~~
However, if I change the statement to the statement below, everything works well. Why is that?
if (beads[0] == *"w")