#include #include using namespace std; struct Emp { // dealing with different datatypes // declared member variables string name; int age; double salary; }; // initiating struct in an external block // soce is public to all members struct Emp source, result;// initiating struct //creating and setting a reference of a function void result1(); int main() { cout << " emp at main office \n"; source.name = "John Doe"; source.age = 42; source.salary = 6500.54 + 10; cout << source.name << " // " << source.age << " // " << source.salary << "\n---- end of struct---\n"; memcpy(&result,&source, sizeof(source)); result1(); return 0; } void result1() { cout << result.name << " // " << result.age << " // " << result.salary << "\n --- end of struct----\n"<< endl; cout<< endl; }