Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこのメソッドのかなり奇妙な(私にとって)使用法を見てきました:
strncpy(somePointer,"%d",someInt);
これは実際に何をしますか?ソースとしての整数指定子"%d"は、私が理解するのが面倒です。
"%d"
缶に書かれていることを実行します。リテラル文字列"%d"を、が指すcharバッファsomePointer、または少なくともその最初のsomeIntバイト(最大3バイト)にコピーします。
somePointer
someInt
パーセント記号に腹を立てないでください、それはただの別の文字です...