#include </usr/include/boost/optional.hpp>
#include <iostream>
using namespace std;
boost::optional<int> test_func(int i)
{
if(i)
return boost::optional<int>(1234);
else
return boost::optional<int>();
return (i);
}
int main()
{
int i;
test_func(1234);
std::cout<< test_func(i) << endl;
return 0;
}
Could any body please tell me y am i getting the value of i as 0, what i want to do is i want to print the values of " i " after entering into " if " condition & also in the " else" part.
Please do the needful, refer me any modification's Thanks Arun.D
Help is greatly appreciated.. thanks in advance