Yet, the code I wrote do not cause any compilation errors( regardless of warnings about strtok ) but when its executed it stops working. This is the code:
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main(){
- char *line = "int a = 10, b; ";
- char *token;
- token = strtok( line, " " );
- cout << token;
- return 0;
- }
And one another thing: why when I change
Expand|Select|Wrap|Line Numbers
- char *line
Expand|Select|Wrap|Line Numbers
- char line[]