First and foremost, using two structures with identical members sounds suspicious because I get the impression you're trying to do something like this when you say you're copying from one to the other:
Code:
struct names_a a;
struct names_b b;
fill_a(&a);
b = a; // Big no-no
Two instances of two structures are never compatible, even if they appear to be declared the same way. That's my first question about your playing with two structure types for the same data.
As I understand it, this is your problem: You have a vector of name_a objects that are already filled with valid data. You want to take each of these objects and copy the data into a name_b object presumably because you have a function that only works with the name_b type. Then you want to copy the modified data back into the original vector of name_a objects.
If that's a correct assessment of your issue, you have no choice but to copy data manually for a conversion:
Code:
name_a makea(name_b& b)
{
name_a ret;
ret.number_of_names = b.number_of_names;
strcpy(ret.name, b.name);
return ret;
}
name_b makeb(name_a& a)
{
name_b ret;
ret.number_of_names = a.number_of_names;
strcpy(ret.name, a.name);
return ret;
}
...
for (int i = 0; i < vsize; i++) {
name_a a = makea(modify_data(makeb(v[i])));
v[i] = a;
}