Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. memcopy in C#

memcopy in C#

Scheduled Pinned Locked Moved C#
csharpdatabasedata-structures
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    youssef
    wrote on last edited by
    #1

    I have an array of bytes like : <00><01><01><03><00><00><01><01><03> I would like to compare if one byte is in the array ( ) an copy at the index of this byte selected to the end of the array ex : Select the and copy it to another array <00><01><01><03><00><00><01><01><03> => result : <00><00><01><01><03> Best Regards youssef

    A H 2 Replies Last reply
    0
    • Y youssef

      I have an array of bytes like : <00><01><01><03><00><00><01><01><03> I would like to compare if one byte is in the array ( ) an copy at the index of this byte selected to the end of the array ex : Select the and copy it to another array <00><01><01><03><00><00><01><01><03> => result : <00><00><01><01><03> Best Regards youssef

      A Offline
      A Offline
      Ami Bar
      wrote on last edited by
      #2

      Check the System.Buffer class. It has a static copy method which you can use.

      1 Reply Last reply
      0
      • Y youssef

        I have an array of bytes like : <00><01><01><03><00><00><01><01><03> I would like to compare if one byte is in the array ( ) an copy at the index of this byte selected to the end of the array ex : Select the and copy it to another array <00><01><01><03><00><00><01><01><03> => result : <00><00><01><01><03> Best Regards youssef

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        If you already have this in a byte[] array, too, you can use Array.Copy (inheritted by your byte[] thanks to hook-ups in the CLR) to pass the start index or even the index into the destination array at which you want to write the new array (the array elements must first exist). This is common throughout the .NET BCL for classes that deal with buffers like this. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups