LoginSignup
0
0

More than 5 years have passed since last update.

Grenning > strtok()は実際に文字列を変更する

Last updated at Posted at 2016-01-11

@ テスト駆動開発による組み込みプログラミング by James Grenning

strtok()は実際に文字列を変更する

test.c
#include <stdio.h>
#include <string.h>

int main(void) {
    char inpBuf[]= "abc,def";
    char *token1;

    printf("%s\n", inpBuf);

    token1 = strtok(inpBuf, "., ");

    printf("%s\n", inpBuf);
    return 0;
}
結果
Success time: 0 memory: 2112 signal:0
abc,def
abc
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0