#include <iostream>
#include <string>

struct Foo {
  void setEmail(std::string) {
    std::cout << __func__ << ", this:" << this << std::endl;
  }

  void setPassword(std::string) {
    std::cout << __func__ << ", this:" << this << std::endl;
  }

  void setName(std::string) {
    std::cout << __func__ << ", this:" << this << std::endl;
  }

  void setAddress(std::string) {
    std::cout << __func__ << ", this:" << this << std::endl;
  }

  void setPhone(std::string) {
    std::cout << __func__ << ", this:" << this << std::endl;
  }
};

int main() {
  void(Foo::*functions[])(std::string) = {
    &Foo::setEmail, &Foo::setPassword, &Foo::setName, &Foo::setAddress, &Foo::setPhone
  };

  constexpr int n = sizeof(functions) / sizeof(functions[0]);

  Foo foo;
  Foo *newAC = &foo;
  std::cout << "newAC:" << newAC << std::endl;
  for (int i = 0; i < n; ++i) {
    (newAC->*functions[i])("hi");
  }
  return 0;
}
