Advertisement
Guest User

nativecall-raku-c++

a guest
Jun 12th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. # this is test.cpp file
  2.  
  3. #include <algorithm>
  4. #include <iostream>
  5. #include <string>
  6.  
  7. int count(std::string String)
  8. {
  9.     return std::count(String.begin(), String.end(), 'a');
  10. }
  11.  
  12. # this is test.raku
  13.  
  14. use NativeCall;
  15. sub count(Str String) returns int64 is native('libtest') { * };
  16.  
  17. say count("pastepaste")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement