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. offset in array

offset in array

Scheduled Pinned Locked Moved C#
csharpc++data-structuresquestion
3 Posts 2 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.
  • R Offline
    R Offline
    Ronenb
    wrote on last edited by
    #1

    Hi, I would like to know how can I refer to array such as byte array with offset such as I would like to use the array from spesific location till the array end in c++ i would do somthing like that char *samplesBuffer int offset = 20; funcName(samplesBuffer+offset) how can I do int in c# thanks ronen

    C 1 Reply Last reply
    0
    • R Ronenb

      Hi, I would like to know how can I refer to array such as byte array with offset such as I would like to use the array from spesific location till the array end in c++ i would do somthing like that char *samplesBuffer int offset = 20; funcName(samplesBuffer+offset) how can I do int in c# thanks ronen

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can't. C# doesn't support that sort of pointer arithmetic. You'd have to pass in the starting index instead. The good news is, the array knows it's length, in C++ you'd still have to pass in a length so you knew how far you could go in it

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      R 1 Reply Last reply
      0
      • C Christian Graus

        You can't. C# doesn't support that sort of pointer arithmetic. You'd have to pass in the starting index instead. The good news is, the array knows it's length, in C++ you'd still have to pass in a length so you knew how far you could go in it

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        R Offline
        R Offline
        Ronenb
        wrote on last edited by
        #3

        thanks Ronen

        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