user55805: Why does the following code return this error?  How can I make this work?

Error: exit status 1 invalid conversion from 'const char*' to 'char'
  [-fpermissive]

#include "FS.h"
#include "SD.h"
#include "SPI.h"

void setup() {
  Serial.begin(115200);

  if (!SD.begin(33)) {
    Serial.println("Card Mount Failed");
  } else {
    Serial.println("Card Mount Succeeded");
  }

  File offline = SD.open("/offlineLog.txt", FILE_READ);

  while (offline.available()) {
    String line = offline.readStringUntil("\n");
    Serial.println(line);
  }
}

The docs say that stream.readStringUntil returns a string...

user4143: The error has nothing to do with what readStringUntil returns. It has to do with what parameters it accepts.
The function expects a single character to look for. Instead you are passing it a string (C string) containing one character.
In C you represent a string (char *) using "", and a single character (char) using ''.
Since readStringUntil expects a char, not a char *, you need to use '':
String line = offline.readStringUntil('\n');


55805: <p>Why does the following code return this error?  How can I make this work?</p>

<blockquote>
  <p>Error: exit status 1 invalid conversion from 'const char*' to 'char'
  [-fpermissive]</p>
</blockquote>

<pre><code>#include "FS.h"
#include "SD.h"
#include "SPI.h"

void setup() {
  Serial.begin(115200);

  if (!SD.begin(33)) {
    Serial.println("Card Mount Failed");
  } else {
    Serial.println("Card Mount Succeeded");
  }

  File offline = SD.open("/offlineLog.txt", FILE_READ);

  while (offline.available()) {
    String line = offline.readStringUntil("\n");
    Serial.println(line);
  }
}
</code></pre>

<p>The docs say that stream.readStringUntil returns a string...</p>
 4143: <p>The error has nothing to do with what <code>readStringUntil</code> returns. It has to do with what parameters it accepts.</p>

<p>The function expects a <em>single character</em> to look for. Instead you are passing it a string (C string) containing one character.</p>

<p>In C you represent a string (<code>char *</code>) using <code>""</code>, and a single character (<code>char</code>) using <code>''</code>.</p>

<p>Since <code>readStringUntil</code> expects a <code>char</code>, not a <code>char *</code>, you need to use <code>''</code>:</p>

<pre><code>String line = offline.readStringUntil('\n');
</code></pre>
