Please help..
-
I have the following procedure where I am converting the first alphanumeric value to appropriate numeric (alphanumeric value is always first position). How should I change the procedure accordingly if alphanumeric value can be on any position? DBCHAR Modifier[4]; int convert_char_modifier(char *Modifier, char *NewModifier) { char NewMod2[8]; char Tempcrap[8]; char Tempcrap1[8]; memset(NewMod2,0x00,sizeof(NewMod2)); memset(Tempcrap,0x00,sizeof(Tempcrap)); memset(Tempcrap1,0x00,sizeof(Tempcrap1)); sprintf(NewModifier, "%02d", Modifier[0] - 64); sprintf(Tempcrap1, "%d", Modifier[1] - 48); strcpy(Tempcrap, Tempcrap1); sprintf(Tempcrap1, "%d", Modifier[2] - 48); strcat(Tempcrap, Tempcrap1); sprintf(NewMod2, "%03s", Tempcrap); strcat(NewModifier, NewMod2); return(0); } Here my examples what I am trying to accomplish: A03-01003 B10-02010 1AD-11030...for the next letter add 10,len of result no more then 5.