Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---- exploring FFI: how to pass in a struct and have it modified?
- int write_test(int start, int count, char* buf) {
- int i=0;
- for(i=0; i<count; i++) {
- *(buf+i) = 0x41+i; // A, B, C...
- }
- return 42;
- }
- './mylib.dylib write_test i i i *' cd 0;10;(10#' ')
- ┌──┬─┬──┬──────────┐
- │42│0│10│ABCDEFGHIJ│
- └──┴─┴──┴──────────┘
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement