I need to compare the elements of a string. I have tried to run the following code but this not work. Any idea how to access element of the string and compare against alphabets ?
char* my_string = "Excellent";
if ( strcmp (my_string[0], "D") )
{
printf("\n\rThe First Element is D: \n\r");
}
if ( strcmp (my_string[0], "E") )
{
printf("\n\rThe First Element is E: \n\r");
}