Determining the length of a text variable

Trying to find the length of a string contained in a variable initialized as type "char" using the string.length() function. First setting an integer variable to hold the string length (tried an "unsigned int" type as well with same results. And those results are "request for member 'length' in 'firststring', which is of non-class type 'char [4]'"

Here is the code:

char firststring = "abc";
char pausestring = "defg";
char secondstring = "hijklm";
int firstlength = 0;
int pauselength = 0;
int secondlength = 0;

void setup() {
// put your setup code here, to run once:
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only

Serial.println("\n\nString length():");

void loop() {
// put your main code here, to run repeatedly:

firstlength = firststring.length(); // This is were the compilation errors out and would presumabley
pauselenght = pausestring.length(); // error out in these next two iterations of the command.
secondlength = secondstring.length();

Serial.println(" - ");

Serial.println(" - ");

Serial.println(" - ");


This part of a larger project to program pulse and delay times for a DYI spot welder and I want to store and retrieve those duration values in a file used to store and then initialize those variables when the programs is terminated and then restarted.

 firstlength = firststring.length();

That would be OK if you were using Strings (uppercase S), but you are using strings (lowercase s)


firstlength = strlen(firststring);

Thanks so much UKHeliBob for the insight. It worked perfectly. I'm pretty new to Arduino and/or C++ but years ago had some experience with Basic, Quick Basic, and SQL, so I'm struggling a bit to "unlearn" and relearn. But much of the basics are the same. Mostly different syntax.