Monday, 9 September 2013

Is this C code optimised?

Is this C code optimised?

char* Migrated[]={"026","109"};
int isMigrated(char* codeB)
{ int i;
int n=sizeof(Migrated)/sizeof(*Migrated);
for(i=0;i<n;i++)
{
if(strcmp(Migrated[i],codeB)==0)
return 0;
}
return -1;
}
is this function optimised from execution time perspective ?

No comments:

Post a Comment