惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 司徒正美
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Palo Alto Networks Blog
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
N
News | PayPal Newsroom
Know Your Adversary
Know Your Adversary
S
Schneier on Security
S
Secure Thoughts
Y
Y Combinator Blog
T
Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
Last Week in AI
Last Week in AI
L
LangChain Blog
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
Simon Willison's Weblog
Simon Willison's Weblog
A
Arctic Wolf
T
The Exploit Database - CXSecurity.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
G
GRAHAM CLULEY
V
Visual Studio Blog
Google Online Security Blog
Google Online Security Blog
L
Lohrmann on Cybersecurity
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
Intezer
有赞技术团队
有赞技术团队
N
News and Events Feed by Topic
W
WeLiveSecurity
Latest news
Latest news
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
F
Full Disclosure
月光博客
月光博客
爱范儿
爱范儿
博客园 - 叶小钗
N
Netflix TechBlog - Medium
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V2EX - 技术
V2EX - 技术
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog

博客园 - 云水浮萍

结构体和类中属性定义需要static地方 十万个为什么收集 群里人问的消息切换分页问题,我就标记一下 AnsiString类型定义的时候可以直接指定代码页,比如950繁体字,936日文 System.Length 函数 Delphi Helper Record Class 向量定义笔记 关于日期与字符串转换时出错的分隔符,小记一下容易忘记 类型与泛型标记 http://docwiki.embarcadero.com/RADStudio/XE7/en/Delphi_Data_Types Delphi中GUID相等检查中经典指针应用 test是否被执行? 每次看到某个数据结构的时候,有两个指针,一个起始,一个结束,一直没想明白为何是起始与结束,不是起始加数量,是怎么操作的? 给自己一个书单 pureMVC学习之一 泛型与无聊 队列与DelphiXe新语法 猫儿山之行计划书 一个错误,一个教训,关于堆栈平衡 - 云水浮萍 - 博客园
CopyMemory Move使用笔记
云水浮萍 · 2015-04-12 · via 博客园 - 云水浮萍

今天群里有人问函数使用问题,我就自己测试一下,顺便学习一下。

uses math;

procedure TForm2.Button1Click(Sender: TObject);
type
  TTArrayByte= array of Byte;
var
  FSource: PAnsiChar;
  FArrayByte:TTArrayByte;
  FSourceLenth: Integer;
  HexStr: string;
begin
  FSource := '123';
  FSourceLenth := Length(FSource);////string=PChar=PWideChar 单个汉字取出长度为1
  SetLength(FArrayByte, FSourceLenth);
  //CopyMemory(@FArrayByte[0], FSource, FSourceLenth);
  //Move(FSource,FArrayByte[0],Min(FSourceLenth,8));

  FArrayByte[0]:=99;
  Move(FSource[1],FArrayByte[1],Min(FSourceLenth,2));

  HexStr := '';
  for FSourceLenth := 0 to FSourceLenth do
  begin
    HexStr := HexStr + inttoHex(FArrayByte[FSourceLenth], 2);
  end;
  ShowMessage(HexStr);

  ShowMessage(PAnsiChar(FArrayByte));
end;

 CopyMemory(数组值地址,数组值地址,长度)