给定了字符串指针及字符串长度,如何取得这个字符串的值?

intcss 2009-04-28 04:56:59
int n3 = 字符串指针位置
string str = " "; 字符串长度为4
int x = lstrcpy(str, n3);
这样得不到str,那位仁兄帮我看看
...全文
51 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
intcss 2009-04-28
  • 打赏
  • 举报
回复
[DllImport("kernel32.dll")]
private static extern int lstrcpy(string lpString1, int lpString2);
intcss 2009-04-28
  • 打赏
  • 举报
回复
我是按照他的说明操作的,得不到值,不知道为什么
LemIST 2009-04-28
  • 打赏
  • 举报
回复
LPTSTR lstrcpyn(          LPTSTR lpString1,
LPCTSTR lpString2,
int iMaxLength
);

类似的,指定长度的
LemIST 2009-04-28
  • 打赏
  • 举报
回复
lpString1
[out] 目标地址
lpString2
[in] 源地址
LemIST 2009-04-28
  • 打赏
  • 举报
回复
汗,这问题
函数不是这样定义的么?
LPTSTR lstrcpy(          LPTSTR lpString1,
LPTSTR lpString2
);

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧