I have this code example and i can't figure out why sscanf works like intended in the example function but not in the main function.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void example(char *seq){
char wert;
while(*seq){
sscanf(seq,"%2x",&wert);
fprintf(stdout,"%c",wert);
seq+=2;
}
}
int main() {
char temp;
char sentence []="1B2873313648";
char *seq=sentence;
example(seq);
printf("\n");
while(*seq){
sscanf(seq,"%2x",&temp);
fprintf(stdout,"%c",temp);
seq+=2;
}
}