How to use strings in esp idf?

Posts: 37
Joined: Mon Jun 26, 2017 11:45 am

How to use strings in esp idf?

Postby Saskia » Sun Jul 30, 2017 6:53 am

I want to tuse the datatype STRING. But i can only do this when i include Arduino.h as a header (+ string.h).
Otherwise i get "'String' does not name a type". Is there another way without Arduino.h?

User avatar
Posts: 1122
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: How to use strings in esp idf?

Postby kolban » Sun Jul 30, 2017 4:18 pm

These days, I am a big fan of writing ESP32 Apps in C++ as opposed to C. I still use the ESP-IDF (not Arduino libraries).

When writing apps in C++, one has access to all the APIs exposed by newlib and ESP-IDF but in addition, a new treasure chest is opened up called the "C++ Standard Library". This is a rich set of libraries that are present with all conformant C++ implementations and the ESP32 is no exception.

Here is the WikiPedia article:

and one facet of this is the class called:


see ...

and now we have the full power of super rich string handling that "just works".
Free book on ESP32 available here:

Who is online

Users browsing this forum: Baidu [Spider] and 14 guests