strtok() is an ugly little function that expects an 'char *'. The pointer you're providing is a 'const char *' (unfortunately it doesn't look like, but it is). So it will crash
To make it work you have to do something like this:
I never said that c is bad, what I mean is why use precompiled .h files when there is a c++ equivalent? why use printf instead cout? Im not saying c is bad, but if you are writing in c++ why use c code that has a c++ equivalilent?
no printf is c but because c++ is built on c you can use anything in it for c++. That doesn't mean you should though. and what do you mean they aren't equivalent both are used for printing text
while c++ is largely oop, thats not what I am talking about. Yes, I have already said that because c++ is built on c, you can just put an int before main and its valid c++. However, I am talking about c++ syntax. In c, printf is used to print text. In c++ that is couts job. You can mix them all you want and probably without compiler error, that doesn't make it proper. Why use a c command (for lack of a better term) when you can use the proper c++ one and actually take up less space in the source. Its like mixing lotr Elvish and English. Lotr Elvish is based off English, however it would be hard to understand because they aren't the same thing
I will say it one more time; printf is a function in the C++ standard library. You include the <cstdio> header from the C++ standard library. This is not the header for the C standard library (stdio.h, the use of which is deprecated in C++). For a compiler to be compliant with the C++ standard it has to implement printf (along with 200 odd other functions), so printf is 'proper C++' (just not class oriented C++)
And I will say it one more time. yes what you said is true however (s)he is using stdio.h, which is a C header file. so, he is writing valid c++ code, however I am targeting syntax. printf would be proper syntax with cstdio, but with a c header file it is written in c flavor. Actually let me rephrase. You are completely right. However if you notice (s)he is using .h files. so can you agree that in this case he isn't writing in proper c++ syntax because he isn't using proper files for it
I'm not commenting on what the OP wrote, just your assertion that printf is not C++.
So the OP posted some code whiteout saying if it is C or C++. If you are unsure if the OP is writing C or C++, then ask them. If it turns out to be C++, them inform them of the correct header to include (if you must). Even with the .h files, it is not wrong or improper C++, deprecated just means that you should not relied upon as it may not be there in future versions of the standard.