/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
using namespace std;
void reference_function(int& y, int& m, int& d, std::string& timeString){
y = 2016;
m = 1;
d = 28;
timeString = "2016-01-28";
}
void pointer_to_ref_function(int* y, int* m, int* d){
std::string s;
reference_function(*y, *m, *d, s);
}
void ref_to_pointer_function(int& y, int& m, int& d) {
pointer_to_ref_function(&y, &m, &d);
}
int main()
{
int y=0, m=0, d=0;
pointer_to_ref_function(&y, &m, &d);
cout<<"y = " << y << "\n";
cout<<"m = " << m << "\n";
cout<<"d = " << d << "\n";
int y2=0, m2=0, d2=0;
ref_to_pointer_function(y2, m2, d2);
cout<<"y2 = " << y2 << "\n";
cout<<"m2 = " << m2 << "\n";
cout<<"d2 = " << d2 << "\n";
return 0;
}