How do I define and use a struct using separate compilation?

I'm having trouble on how to define a struct in my header file and implement it using my implementation file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"Friends.h"
#ifndef FRIENDS_H_
#define FRIENDS_H_

class Friends {
	private:
		struct name_struct { string fname, flame; };
	public:
		struct name_struct getNameStruct();
		string getFirstName();
};

#endif /* FRIENDS_H_ */

"Friends.cpp"
#include "Friends.h"
...
// How do I initialize?
// How do I implement getNameStruct and getFirstName?
...
Last edited on
bump
Topic archived. No new replies allowed.