viewCount="12345";char this_char[viewCount.length() + 1];viewCount.toCharArray(this_char, sizeof(this_char)); int newCount = atoi(this_char); Serial.println(newCount);
working with string instead of char* is already some overkill,
Quoteworking with string instead of char* is already some overkill,Did you mean, "working with String instead of char* is already some overkill,"?
lowercase "string" is just a confusing word for a char array.
... a string is a char array that is null-terminated, but a char array doesn't have to contain a string.
usually omitting "unsigned" is laziness,
typedef uint8_t byte;
string sample="Some Sample Text";
On an arduino, working with string instead of char* is already some overkill, IMOchar* viewCount="1234567";long number = atol(viewCount);should already work fine
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16