Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this is test.cpp file
- #include <algorithm>
- #include <iostream>
- #include <string>
- extern "C" int count(std::string String)
- {
- return std::count(String.begin(), String.end(), 'a');
- }
- # this is test.raku
- use NativeCall;
- sub count(Str $str is encoded('utf8')) returns int32 is native('libtest') { * };
- say count("pastepaste")
Add Comment
Please, Sign In to add comment