title: How to define function inside the argument of a function that takes function as argument
body: <pre><code>#include &lt;iostream&gt;
  void print(void func(int)){
    func(6);
  }
  int main(){
    print(void ext(int r){
    std::cout&lt;&lt;r;
    });
    return 0;
  }
  </code></pre>
  
  <p>i want to define a function inside the parameter itself instead of defining it somewhere else and using its name as parameter. Like in javascripts.</p>