vc

バッファ操作1

vc

特定のバッファから別のバッファへ、指定された文字または指定された文字数がコピーされるまで文字をコピーします。 // crt_memccpy.c #include <memory.h> #include <stdio.h> #include <string.h> char string1[60] = "The quick brown dog jumps over the lazy fox"; int main( void ) </string.h></stdio.h></memory.h>…

可変長引数のサポート

vc

http://msdn2.microsoft.com/ja-jp/library/kb57fad8(VS.80).aspx // crt_va.c /* The program below illustrates passing a variable * number of arguments using the following macros: * va_start va_arg va_end * va_list va_dcl (UNIX only) */ #inclu…

ファイルサイズを取得し、ファイルサイズを変更する

vc

ファイルサイズを取得する関数はCの標準にあるのかないのか良く分からん・・・。 // crt_chsize.c // This program uses _filelength to report the size // of a file before and after modifying it with _chsize. #include <io.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h></sys/stat.h></sys/types.h></fcntl.h></io.h>…