The operator >> is not used for assignment ! You could assign using strncpy like this strncpy(names, data ...
stackoverflow.com