close

當使用sscanf 要抓出一些字串的時候

可以使用以下格式

%[a-zA-Z] 表示字串a到z A到Z的字串都抓出來


當字串含有括號 如
char str[15] = "abc def [sfd] this is";
要抓this之前的所有字元時
可以用
%[][a-zA-Z ] 這樣的表示來存


全站熱搜
創作者介紹
創作者 coolkevin 的頭像
coolkevin

about my life

coolkevin 發表在 痞客邦 留言(0) 人氣()