This may seem silly to most. I want to use a structure that is in another file. I will be the only one using this structure. This file is just a header file of structures. In my main file I have a method that I will want to stuff this structure (for simplicity let's call it names_a) with data from another structure (names_b) which is in another header file. Another method initially populates "name_b" with data. In a different method I want to then copy the contents from "names_a" back into "names_b". Both methods are located in the same file. Can someone please show me an example of how I can do this? Thanks in advance!
JK
Code:struct names_a { int number_of_names; char name[10]; } struct names_b { int number_of_names; char name[10]; }



LinkBack URL
About LinkBacks



I really can't make out what you're trying to do. Apparently you're getting this data from another application, from a file, and from a vector all at the same time. And the purpose of the code is just as unclear (to count names? of what? huuuh?
). I believe what Prelude was trying to say is judging from the information you've given us, it doesn't sound like you need to do all this structure shuffling at all - but since you haven't told us enough for us to figure out what the heck is going on, there's no way for us to know.