Created
October 9, 2016 18:39
-
-
Save nadavmatalon/2f001bad0765b5e6f8d96d0729eb0d73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code Author: Mikal Hart | |
// Code Source: http://arduiniana.org/libraries/pstring/ | |
// Direct use (no constructor): | |
char buffer[30]; | |
float pi 3.14159; | |
PString(buffer, sizeof(buffer), pi); | |
// Construct an object: | |
char buffer[50]; | |
PString str(buffer, sizeof(buffer)); | |
str = "Joe"; | |
str += 45; | |
// Useful functions: | |
Serial.print(str); // prints str | |
str.length(); // actual length of str | |
str.capacity(); // str general capacity | |
str.begin(); // Resets str (sets pointer to the begining of str) | |
str == "other" // Comparison between str and another string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment