Serial Number
22 posts
• Page 3 of 3 • 1, 2, 3
- 3.141592
- Junior Member
- Posts: 5
- Joined: Sun Aug 13, 2017 5:59 am
- Calculators: Casio fx-9860GII SD Power Graphic 2
Re: Serial Number
qferqo wrote:Thanks for the clarification! I wasn't aware of that fact.
this method is like strcmp( , );
int AddIn_main(int isAppli, unsigned short OptionNum)
{
int pass;
unsigned char str[32];
const unsigned char * deviceId = (unsigned char *) 0xA000FFD0 , * s = (unsigned char *)"A1234567";
for(i=0 ; i<8 ; i++){ if(deviceId[i]!=s[i]){ pass=0; break;}}
while(pass)
{ PrintXY(1,1,(unsigned char *) "Serial Number is OK", 0);
/* any code that you want*/
}
return 1;
}
- 3.141592
- Junior Member
- Posts: 5
- Joined: Sun Aug 13, 2017 5:59 am
- Calculators: Casio fx-9860GII SD Power Graphic 2
Re: Serial Number
strcmp( ,) , strncmp(,) or memcmp(,) does not return 0 for equal comp. ; this method work perfectly.
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int pass=1;
unsigned char str[32];
const unsigned char * deviceId = (unsigned char *) 0xA000FFD0 , * s = (unsigned char *)"01234567";
for(i=0 ; i<=7 ; i++){ if(deviceId[i]!=s[i]){ pass=0; break;}}
while(pass)
{ PrintXY(1,1,(unsigned char *) "Serial Number is OK", 0);
/* any code that you want*/
}
return 1;
}
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int pass=1;
unsigned char str[32];
const unsigned char * deviceId = (unsigned char *) 0xA000FFD0 , * s = (unsigned char *)"01234567";
for(i=0 ; i<=7 ; i++){ if(deviceId[i]!=s[i]){ pass=0; break;}}
while(pass)
{ PrintXY(1,1,(unsigned char *) "Serial Number is OK", 0);
/* any code that you want*/
}
return 1;
}
22 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 3 guests