hi
1. what is the difference between strcpy and memcpy
2. what is memory leak?
3. what is the difference between general operating system and real time operating system.
Thanks
yasodhar premchand
|
Go4Expert Founder
|
![]() |
| 10Oct2006,10:03 | #2 |
|
Quote:
Originally Posted by prem_may10 strcpy allows null-terminated memory blocks to be copied to different locations. Since, in C, strings are not first-class datatypes, and are implemented as blocks of ASCII bytes in memory, strcpy will effectively copy strings given two pointers to blocks of allocated memory. memcpy memcpy() works on arbitrary data of a given fixed length use memcpy() when you want to copy an exact amount of data (possibly containing embedded null chars) from one location to another, and strcpy() when you want to copy a variable-length null-terminated C string from one location to another... Quote:
Originally Posted by prem_may10 Quote:
Originally Posted by prem_may10 |
|
Go4Expert Member
|
|
| 10Oct2006,12:29 | #3 |
|
hi
still i am not getting the diffrence between strcpy and memcpy. can u explain with examples. Thanks yasodhar premchand |
|
Go4Expert Founder
|
![]() |
| 10Oct2006,13:23 | #4 |
|
strcpy is used for copying strings (terminated by a null '\0') but memcpy can be used to copy some data of finite length to the desired memory location.
memcpy(bufDest,bufSrc,100); // Will copy 100 bytes whatever be the content be strcpy(bufDest,bufSrc); // Will copy all the bytes till it finds the first null terminating character |
|
Light Poster
|
|
| 9Jun2008,17:46 | #5 |
|
[QUOTE=prem_may10][COLOR=Blue][B]hi
1. what is the difference between strcpy and memcpy strcpy is a function to copy a charactor array in given memory into another location and leaving the original string in its adress whilst memcopy copies copies all the contents of a given memory |

