Optimization for C isMigrated function char* Migrated[]={"026","109"};

int isMigrated(char* codeB)
{   
    int i;
    int n=sizeof(Migrated)/sizeof(*Migrated);

    for(i=0;i&lt;n;i++)
    {   
        if(strcmp(Migrated[i],codeB)==0)
            return 0;
    }
    return -1;
}


is this function optimised from execution time perspective ?

Migrated should contain at maximum 200 value all of them are 4 byte .
I am not sure how far you intend to expand Migrated, but something like this could be an optimisation:

char* Migrated[]={"026","109"};

int isMigrated(char* codeB)
{   
    int i;
    // since we know that all strings in Migrated are 4 bytes long
    int32_t _codeB_as_int32 = *(int32_t *)codeB; 
    int32_t * Migrated_as_int32 = Migrated;

    for(i=0;
        i&lt;sizeof(Migrated)/sizeof(*Migrated); // sizeof is a compile time constant, better to put it here
        i++)
    {   
        if(codeB == Migrated_as_int32[i])
            return 0;
    }
    return -1;
}


it all really depends on what you intend to have in Migrated.