请问向txt文本输出这样的格式应该这样写代码啊? ( 积分: 50 )

  • 主题发起人 主题发起人 tyc2000
  • 开始时间 开始时间
真大意,是:strcat(buf,"/r/n");
 
呵呵,谢谢 腰子比猪大 搞定了,
谢谢 islet8 但我在api参考大全里也没找到啊
 
多人接受答案了。
 
汗。。实在不明白你怎么会找不到CopyMemory这个API的[:(]

CopyMemory
The CopyMemory function copies a block of memory from one location to another.

void CopyMemory(
PVOID Destination,
const VOID* Source,
SIZE_T Length
);
Parameters
Destination
[in] Pointer to the starting address of the copied block's destination.
Source
[in] Pointer to the starting address of the block of memory to copy.
Length
[in] Size of the block of memory to copy, in bytes.
Return Values
This function has no return value.
Remarks
This function is defined as the RtlCopyMemory function. For more information, see Winbase.h and Winnt.h.
If the source and destination blocks overlap, the results are undefined. For overlapped blocks, use the MoveMemory function.

Warning The first parameter, Destination, must be large enough to hold Length bytes of Source;
otherwise, a buffer overrun may occur. This may lead to a denial of service attack against the application if an access violation occurs or, in the worst case, allow an attacker to inject executable code into your process. This is especially true if Destination is a stack-based buffer. Be aware that the last parameter, Length, is the number of bytes to copy into Destination, not the size of the Destination.
The following code example shows a safe way to use CopyMemory:
void test(char *pbData, unsigned int cbData) {
char buf[BUFFER_SIZE];
CopyMemory(buf, pbData, min(cbData,BUFFER_SIZE));
}
 
哦,找到了,thanks.希望以后能多多指教,我在要用delphi,不过初学,我qq:50602040
 
后退
顶部