Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Strtok operations seem to fail in runtime #16763
    gryphacus
    Participant

    Well, I’ve solved the problem. I’m not sure how the code manages to execute on the Arduino Nano, but in reality it contains undefined behavior. Defining mystring as a char* implies it is constant, however strtok() and similar operations perform directly on the string. Obviously, this can’t be done if the string is constant.

    Simply modifying the code to redefine mystring as “char mystring[] = “…”;” is all that is required.

Viewing 1 post (of 1 total)