unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls; type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  end; var
  Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
var
  p,p1: PChar;
begin
  p1 := 'Delphi';
  GetMem(p, );   lstrcpy(p, p1);
  ShowMessage(p); {Delphi}   FreeMem(p);
end; procedure TForm1.Button2Click(Sender: TObject);
var
  p,p1,p2: PChar;
begin
  p1 := 'Delphi';
  p2 := '2009';
  p := StrAlloc();   lstrcpy(p, p1);
  lstrcpy(p, p2);
  ShowMessage(p); {2009}   StrDispose(p);
end; procedure TForm1.Button3Click(Sender: TObject);
var
  p: PChar;
  buf: array[..] of Char;
begin
  p := '万一的 Delphi 博客';
  lstrcpy(buf, p);
  ShowMessage(buf); {万一的 Delphi 博客}
end; end.

WinAPI 字符及字符串函数(10): lstrcpy - 复制字符串的更多相关文章

  1. Lesson12——NumPy 字符串函数之 Part1:字符串操作函数

    NumPy 教程目录 1 NumPy 字符串函数 以下函数用于对 dtype 为 numpy.string_ 或 numpy.unicode_ 的数组执行向量化字符串操作. 它们基于 Python 内 ...

  2. WinAPI 字符及字符串函数(9): lstrcat - 合并字符串

    unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, For ...

  3. Lesson14——NumPy 字符串函数之 Par3:字符串信息函数

    NumPy 教程目录 1 字符串信息函数 1.1 numpy.char.count char.count(a, sub, start=0, end=None) 返回一个数组,其中包含 [start, ...

  4. Linux下常用函数-字符串函数

    inux下常用函数-字符串函数 atof(将字符串转换成浮点型数)  相关函数   atoi,atol,strtod,strtol,strtoul 表头文件   #include <stdlib ...

  5. mysql字符串函数(转载)

    对于针对字符串位置的操作,第一个位置被标记为1. ASCII(str) 返回字符串str的 最左面字符的ASCII代码值.如果str是空字符串, 返回0.如果str是NULL,返回NULL. mysq ...

  6. MySQL数据库学习笔记(五)----MySQL字符串函数、日期时间函数

    一.常见字符串函数: 1.CHAR_LENGTH  获取长度(字符为单位) 2.FORMAT  格式化 3.INSERT  替换的方式插入 4.INSTR  获取位置 5.LEFT/RIGHT  取左 ...

  7. sql中的字符串匹配、函数大全

    假设你想建立一个与Yahoo功能相似的Internet目录.你可以建立一个表用来保存一系列的站点名称,统一资源定位器(URL),描述,和类别,并答应访问者通过在HTML form中输入要害字来检索这些 ...

  8. 【转】mysql字符串函数

    对于针对字符串位置的操作,第一个位置被标记为1(即:第一个字母索引为1). ASCII(str) 返回字符串str的 最左面字符的ASCII代码值.如果str是空字符串, 返回0.如果str是NULL ...

  9. mysql 字符串函数

    对于针对字符串位置的操作,第一个位置被标记为1. ASCII(str) 返回字符串str的 最左面字符的ASCII代码值.如果str是空字符串, 返回0.如果str是NULL,返回NULL. mysq ...

随机推荐

  1. Mysql总结(二)

    数据库.表.字段.行 问:查询姓黄或洪的男生分析:数据从哪来,哪个表stu条件:姓黄或洪name or and 男生gender答:select * from stu where gender=1 a ...

  2. Halcon学习之八:图像区域叠加与绘制

    版权声明:本文为博主原创文章,未经博主允许不得转载. overpaint_gray ( ImageDestination, ImageSource : : : )  将灰度值不相同区域用不同颜色绘制到 ...

  3. leetcode334

    public class Solution { public bool IncreasingTriplet(int[] nums) { var len = nums.Length; ) { retur ...

  4. totoise svn误将桌面作为checkout路径,界面一堆?

    工作中由于错误操作,totoise svn检出文件时,直接选择检出路径为桌面,这样导致界面一大堆“?”:看起来比较烦,上网查找处理方案: 其中一个最简单的方法是: 第一步:新建txt文件: 第二步:输 ...

  5. 【转】tcp_tw_recycle和tcp_timestamps导致connect失败问题

    (2012-02-01 18:40:32)     近来线上陆续出现了一些connect失败的问题,经过分析试验,最终确认和proc参数tcp_tw_recycle/tcp_timestamps相关: ...

  6. a different object with the same identifier value was already associated with the session解决方案

    org.springframework.orm.hibernate3.HibernateSystemException: a different ]; nested exception ] at or ...

  7. Python实现阿里云短信推送

    本篇文章是使用Python的Web框架Django提供发送短信接口供前端调用,Python版本2.7 阿里云入驻.申请短信服务.创建应用和模板等步骤请参考:阿里云短信服务入门 1.下载sdk 阿里云短 ...

  8. 124. Binary Tree Maximum Path Sum (Tree; DFS)

    Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence ...

  9. 191. Number of 1 Bits 二进制中1的个数

    [抄题]: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (als ...

  10. 136. Single Number唯一的数字

    [抄题]: Given an array of integers, every element appears twice except for one. Find that single one. ...