Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Escaping things
#include <stdio.h>
#include <string>
#include <string.h>
int main() {
std::string str = "ab:cd:ef";
const char *psz = str.c_str();
for (;;)
{
const char *pszNext = strpbrk(psz, ":");
if (!pszNext)
{
printf("%s", psz);
break;
}
printf("%.*s\\%c", pszNext - psz, psz, *pszNext);
psz = pszNext + 1;
}
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.