Gets a pointer (const char *) to the internal c-string representation of the string. You can use this to pass to a function that require a c-string. This string cannot be modified.
The object also supports
operator const char * so for things that specifically take a c-string (like Particle.publish) the conversion is automatic.
You would normally use c_str() if you need to pass the string to something like Serial.printlnf or Log.info where the conversion is ambiguous:
Log.info("the string is: %s", string.c_str());
This is also helpful if you want to print out an IP address:
Log.info("ip addr: %s", WiFi.localIP().toString().c_str());