回覆列表
  • 1 # 老生談笑

    先將所有的讀進來存在一個字串中,然後用字元分割函式strtok()//具體可參見API例如: char str[] = "now # is the time for all # good men to come to the # aid of their country"; char delims[] = "#"; char *result = NULL; result = strtok( str, delims ); while( result != NULL ) { printf( "result is \"%s\"\n", result ); result = strtok( NULL, delims ); }以上程式碼的執行結果是: result is "now " result is " is the time for all " result is " good men to come to the " result is " aid of their country"

  • 中秋節和大豐收的關聯?
  • 天龍八部那些433,444,544石頭什麼的是什麼意思?