Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

memcpy in cpp

#include <cstring>
#include <iostream>
using namespace std;

int main() {
  char source[] = "Tutorial";
  char destination[] = "Programiz";

  // copy all bytes of destination to source
  memcpy(destination, source, sizeof(source));

  cout << destination;

  return 0;
}

// Output: Tutorial
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #memcpy #cpp
ADD COMMENT
Topic
Name
3+4 =