You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
509 B

#include <iostream>
#include <cstring>
#include <cfrob.hpp>
// Can be stored as `const char` array with compile-time size for optimal use.
const auto str = "Hello world."_frob;
constexpr const char* str2 = "Hello world."_frob;
// Can also be stored as normal `const char*` string constant pointer.
const char* str3 = "Hello world."_frob;
int main()
{
char* str2 = strdup(str);
memfrob(str2, strlen(str));
std::cout << str << std::endl;
std::cout << str2 << std::endl;
free(str2);
return 0;
}