So in I created this structure first,

typedef struct{ name1_t name1; name2_t name2; } names_t;

and I implemented this scanf function to read the data from a txt file,

void read(names_t *names){
        scanf("%s %s", &names->name1, &names->name2);
        }

The input is

Jack some_random_name
Kittyyy here_is_another_name
Jason third_name

The output for name1 and name2 are

Jack
some_random_name
Kittyyyhere_is_another_name
here_is_another_name
Jason
third_name

I am not sure where I did wrong, for some input it reads name1 and name2 as a whole and reads name2 again.

🔴 No definitive solution yet