sscanf !!

I have a string

Form this string, I want to extract

I am unable to do that with sscanf because of the space between the words. What else can I use?

#include <stdio.h>

char buf_2[50];

int
main()
{
        char *buf_1 = "\\\\?\\whats going on";

        sscanf(buf_1, "\\\\?\\%s", buf_2);

        printf("buf_1 = %s\n", buf_1);
        printf("buf_2 = %s\n", buf_2);

        printf("Thats all folks... !\n");

        return 0;

}

The output of the above program is:

thanks

char *buf_2=buf_1;

if (!memcmp(buf_2,"\\\\?\\",4)) buf_2+=4;

Proter ! thats just awesome man... Thanks !!

As long as you understand what it is doing.

Change your sscanf as below and then try.

sscanf(buf_1, "\\\\?\\%49c", buf_2);