#include <iostream>
int areaCalc(int*);
int main(){
int width = 4;
int area = width * width;
cout << "Area (manual calc): " << area << endl;
int area_from_func = areaCalc(&width);
cout << "Area (func calc): " << area_from_func << endl;
return 0;
}
int areaCalc(int* width_address){
int area = (*width_address) * (*width_address);
return area;
}
No comments:
Post a Comment