Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) StdMemcpyExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppStdMemcpyExample1/CppStdMemcpyExample1.pro

 

include(../../ConsoleApplication.pri)

SOURCES += main.cpp

 

 

 

 

 

./CppStdMemcpyExample1/main.cpp

 

#include <cassert>
#include <cstring>
#include <vector>

int main()
{
  const std::vector<int> from = {1,4,9,16,25,36,49};
  std::vector<int> to(from.size());
  std::memcpy(&to[0],&from[0],from.size() * sizeof(int));
  assert(from==to);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml