strtok function takes in s and delimiter as parameters. In the video @10:09 sir has written the following statement:
char s=strtok((char)str.c_str(), " ");
what does the first parameter [(char*)str.c_str()] given to the function mean here?
strtok function takes in s and delimiter as parameters. In the video @10:09 sir has written the following statement:
char s=strtok((char)str.c_str(), " ");
what does the first parameter [(char*)str.c_str()] given to the function mean here?
Hey @somesh.ps
c_str() is used to convert string into char array and return const char* which we typecasted to char* for passing it to strtok function.