user56312: I have a Wemos D1 board with a OLED display using the u8g2 library.
I am printing my MAC-adress on the serial port & would like to print the same information on the OLED:

#include <ESP8266WiFi.h>
#include <U8g2lib.h>
byte mac[6];
setup(){
  Serial.println(WiFi.macAddress());
  WiFi.macAddress(mac);
  u8g2.drawStr(1,10,WiFi.macAddress());
  u8g2.sendBuffer();
}

This does not work. It prints the MAC-address on the serial port but not on the OLED.
I get: no known conversion for argument 3 from 'String' to 'const char*
How can I print the MAC-information on my oled using the u8g2-library? 

user56652: As said by @Mikael Patel
You need to append .c_str() to u8g2.drawStr(1,10,WiFi.macAddress()); creating the line: u8g2.drawStr(1,10,WiFi.macAddress().c_str());
The problem is that WiFi.macAddress() returns a String not the needed const char* by the drawStr function. c_str converts the String object into a const char*.
Please look at the documentation of the u8g2 library for the drawStr function.
link
And here the documentation for String
link

56312: <p>I have a Wemos D1 board with a OLED display using the u8g2 library.</p>

<p>I am printing my MAC-adress on the serial port &amp; would like to print the same information on the OLED:
</p>

<pre class="lang-cpp prettyprint-override"><code>#include &lt;ESP8266WiFi.h&gt;
#include &lt;U8g2lib.h&gt;
byte mac[6];
setup(){
  Serial.println(WiFi.macAddress());
  WiFi.macAddress(mac);
  u8g2.drawStr(1,10,WiFi.macAddress());
  u8g2.sendBuffer();
}
</code></pre>

<p>This does not work. It prints the MAC-address on the serial port but not on the OLED.</p>

<p>I get: no known conversion for argument 3 from 'String' to 'const char*</p>

<p>How can I print the MAC-information on my oled using the u8g2-library? </p>
 56652: <p>As said by @Mikael Patel
You need to append <code>.c_str()</code> to <code>u8g2.drawStr(1,10,WiFi.macAddress());</code> creating the line: <code>u8g2.drawStr(1,10,WiFi.macAddress().c_str());</code></p>

<p>The problem is that <code>WiFi.macAddress()</code> returns a <code>String</code> not the needed <code>const char*</code> by the <code>drawStr</code> function. <code>c_str</code> converts the <code>String</code> object into a <code>const char*</code>.</p>

<p>Please look at the documentation of the <code>u8g2</code> library for the <code>drawStr</code> function.</p>

<p><a href="https://github.com/olikraus/u8g2/wiki/u8g2reference#drawstr" rel="nofollow noreferrer">link</a></p>

<p>And here the documentation for <code>String</code></p>

<p><a href="https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/" rel="nofollow noreferrer">link</a></p>
