IT. Expert System.

C

memcpy()


The C library function void *memcpy(void *str1, const void *str2, size_t n) copies n characters from memory area str2 to memory area str1.

Syntax:
void *memcpy(void *dest, void *src, size_t count);


Example:

memcpy( ) function is used to copy a specified number of bytes from one memory to another.
#include 
#include 
int main()
{
   // define two identical arrays
   char str1[10] = "technicia";
   char str2[10] ;
   if (memcpy(str2,str1, strlen(str1)))
   {
      printf("Elements in str1 are copied to str2 .\n");
      printf("str1 = %s\n str2 = %s \n", str1, str2);
   }
   else
     printf("Error while coping str1 into str2.\n");
   return 0;
}
Output:

Elements in str1 are copied to str2 .
str1 = technicia
str2 = technicia


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1152 / . Delta: 0.00592 с