Check out example codes for "lexiographic value of string c++". It will help you in understanding the concepts better.

Code Example 1

#include<iostream> 
#include<algorithm> // for lexicographical_compare() 
using namespace std; 
  
int main() 
{ 
    char one[] = "mynameisomkar"; 
    char two[] = "xyz"; 
    if( lexicographical_compare(one, one+13, two, two+3)) 
    { 
        cout << "mynameisomkar is lexicographically less than xyz"; 
    } 
    else
    { 
        cout << "mynameisomkar is not lexicographically less than xyz"; 
    } 
}

Learn ReactJs, React Native from akashmittal.com