Skip to content

Instantly share code, notes, and snippets.

@dpogue
Last active July 31, 2023 17:25
Show Gist options
  • Save dpogue/c3d8ac1cf649c7923ea29d5c83eb0b3b to your computer and use it in GitHub Desktop.
Save dpogue/c3d8ac1cf649c7923ea29d5c83eb0b3b to your computer and use it in GitHub Desktop.
#include <CoreFoundation/CoreFoundation.h>
#include <stdio.h>
int main(int argc, char** argv)
{
CFStringRef str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
printf("Ref Count: %d\n", CFGetRetainCount(str));
return 0;
}
// Build with:
// $ clang -o cftest cftest.c -framework CoreFoundation
//
// Run with:
// $ ./cftest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment