If what you want is to get a character from an array to use it from idn you can try something like this:
#include <stdio.h>
int main(void) {
char id[10] = {'h','o','l','a'};
char *idn;
//FILE *in;
//fscanf(in,"%s",id);
idn = &id[0]; //<- tomas la posicion que quieres en este caso la 0
printf("%c\n",*idn); //<- usas como formato %c
printf("%s\n",id);
return 0;
}
Test-ideone
If you want to do something similar to this arr = arr1
you can use snprintf
.
#include <stdio.h>
int main(void) {
char id[10] = {'h','o','l','a'};
char idn[10];
//FILE *in;
//fscanf(in,"%s",id);
size_t des_size = sizeof (idn);
snprintf(idn, des_size, "%s", id);
printf("%s\n",idn);
return 0;
}
link
Test-ideone
You could also use strncpy(idn, id, des_size);
but you have to take into account the following that the documentation says:
No null-character is implicitly appended at the end of destination if
source is longer than num Thus, in this case, destination shall not
be considered a null terminated C string (reading it as such would
overflow).
In the link you can see an example of how to handle this situation.
link