- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
#include <iostream>
using std::cout;
using std::endl;
auto power(double x, int n)-> double*;
int main()
{
void * c = power(5,2);
std::cout << *(double*)c << std::endl;
return 0;
}
auto power(double x, int n)-> double*
{
double* result(new double(1.0));
for(int i = 1; i <= n; i++)
*result *= x;
return result;
}