|
The OP
Published on 2013-12-16 14:31
Only look at the author
This post is from Programming Basics
Latest reply
if(*dest == NULL) {strcpy(*dest,buff);return -1;} // Ensure that the original data can be recovered when allocation error occurs; I think there is something wrong with your answer. In the case of buff = *dest;, it is just equivalent to saving the pointer. So the meaning of strcpy(*dest,buff) is closer to *dest++= *dest++. It is the same as throwing the pointer back to *dest = buff. If buff=malloc (*dest), the whole data chain is saved. In addition, you said free(buff); is wrong? [ This post was last edited by 虚V界 on 2013-12-17 13:41]
Details
Published on 2013-12-17 13:36
| ||
|
|
||
|
gaoyang9992006
Currently offline
|
2
Published on 2013-12-16 14:34
Only look at the author
|
|
|
|
|
|
This post is from Programming Basics
| ||
|
|
||
|
|
This post is from Programming Basics
| ||
|
|
||
|
|
|
5
Published on 2013-12-16 19:45
Only look at the author
| |
|
|
|
|
|
|
gaoyang9992006
Currently offline
|
6
Published on 2013-12-16 21:10
Only look at the author
|
|
|
|
|
|
|
7
Published on 2013-12-17 13:36
Only look at the author
This post is from Programming Basics
| ||
|
|
||
|
|
This post is from Programming Basics
| ||
|
|
||
|
|
This post is from Programming Basics
| ||
|
|
||
|
|
This post is from Programming Basics
| ||
|
|
||
|
|
This post is from Programming Basics
| ||
|
|
||
|
|
This post is from Programming Basics
| ||
|
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
|
Visited sections |
曾经的版主且威望大于2000,或对EEWORLD论坛有突出贡献的坛友
EEWorld Datasheet Technical Support
EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building,
Block B, 18 Zhongguancun Street, Haidian District,
Beijing 100190, China
Tel:(010)82350740
Postcode:100190
京公网安备 11010802033920号

