mkdir -p /tmp/test_code && cd /tmp/test_code touch test.cpp code .
#include <stdio.h> #include <math.h> #include <iostream> int *set_foo_pointer(int a, int b) { int *c = new int; *c = pow(a, 2) + pow(b, 2); std::cout << "Value of c: " << *c << std::endl; return c; } int main() { int *a = new int; a = set_foo_pointer(3, 5); std::cout << "Value of a: " << *a << std::endl; return 0; }
g++ test.cpp ./a.out
Value of c: 34 Value of a: 34
Experienced Researcher with a PhD in Automatic Control and Robotics and a demonstrated history of working in robotics research projects for both academia and industry.