OK so I'm trying to parse simple URL's from a whole char chunk using strtok but always keeps giving me an unhandled exception error . SO here is all the code in C++ :
char* str = "(%/\%)google.com(%/\%)hotmail.com(%/\%)nananna.org(%/\%)"
char *url[];
while(str != NULL){
url[0] = strtok(str, "(%/\%)");
if (DownloadFile_1(url[0],szPath) == 0);{// Writes "URL 1"
ExitProcess(0);
}
url[1] = strtok (NULL, "(%/\%)");
if (DownloadFile_1(url[1],szPath) == 0);{// Writes "URL 2"
ExitProcess(0);
}
url[2] = strtok (NULL, "(%/\%)");
if (DownloadFile_1(url[2],szPath) == 0);{// Writes "URL 3"
ExitProcess(0);
}
}
EDIT** : str can only be a const or char* because the function that I'm using with it uses const char.