String to Decimal char array

is it possible to convert a string into a decimal char array (instead of A, its gonna be 65)

it's alread that. see ASCII table

but,i need to decode a full string

Can you provide an example of the input and what you want the output to be?

intput:

char input_string[] = "ABCDEFG";

output:
????

hello world
 104 101 108 108 111 32 119 111 114 108 100
 68 65 6C 6C 6F 20 77 6F 72 6C 64


const char *s = "hello world";

// -----------------------------------------------------------------------------
void
setup (void)
{
    Serial.begin (9600);

    Serial.println (s);

    for (unsigned n = 0; n < strlen(s); n++)  {
        Serial.print (" ");
        Serial.print (s [n], DEC);
    }
    Serial.println ();

    for (unsigned n = 0; n < strlen(s); n++)  {
        Serial.print (" ");
        Serial.print (s [n], HEX);
    }
    Serial.println ();
}

// -----------------------------------------------------------------------------
void
loop (void)
{
}

thanks.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.