Hi :).
I don't found good examples for function sscanf(). Can you help me please with this situation?
#include <cstdio>
#include <iostream>
using namepsace std;
int main(int argc, char const *argv[])
{
string way = "main/articles/animals/giraffe";
char arr[256]; char arr2[256];
sscanf(way.c_str(), "%[^'/']/", arr);
cout << arr << endl;
return 0;
}
I need in one string "main" and in the second "articles/animals/giraffe".
How can I get the second part? And how can I use only "%" - without "%s" for string.
Is it possible have string instead of char arr[256]?
Thanks a lot :)!