How can I use a c file mac.c in a php shopping cart project.
mac.c
#include <stdio.h>
#include <string.h>
typedef union {
unsigned short s[3];
unsigned char c[6];
} Converter;
int main(void) {
Converter conv;
/ Assign to conv.c. You probably need to use network byte order in your case. /
strncpy(conv.c, "123456", 6);
/ Read from conv.s /
printf("%04x%04x%04x\n", conv.s[0], conv.s[1], conv.s[2]);
return 0;
}