How to use bind function in C++

1 Answer

0 votes
#include <iostream> 
#include <functional> 

using namespace std; 
  
void f(int a, int b) { 
    cout << a << " " << b << endl; 
} 
  
int main() 
{ 
    auto fn =  bind(f, 345, 54); 
  
    fn(); 

    return 0; 
} 

 



answered Feb 6, 2020 by avibootz
...