I have a simple function that passes a variable "var" as a u_char array. I have no difficulty printing that array.
printf("%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", var[0], var [1], var[2], var[3], var[4], var[5]);
Prints the mac address out just the way I like it.
I cannot for the life of me figure out the proper way to store this Mac address and compare it with another string. Ideally, this is what I'm after:
global OldString="00:00:00:00:00:00"
NewString=getCurrentMacAddress();
if OldString = Newstring then ignore else some_function
But I have been banging my head against a wall all day just trying to store this "var" output as a string. I tried strcpy, I tried looping with a for loop, I tried everything I could find on google from malloc to global declaration in lieu of passing the value to the function.
Any help is appreciated. I'm completely new to C and just trying to write a simple little tool... It's taking way longer than it should.