473,799 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

an offset reference to an array?


I wish to create an array that points to, say, the middle
section of a different array.

eg
Original array >[0] [1] [2] [3] [4] [5] [6] [7]
second array-------------^
[0] [1] [2] [3] [4] [5]

Is this at all possible?? I think that it could be done in
c++, but I dont have a clue as to how to do it in vb.net
if it is even possible.

thanks for all help
Nov 20 '05 #1
12 1943
Why would you want to do this???

Are you wanting an array of arrays or what?
Maybe telling us the application would be helpful....at least a made up
application of what you want to accomplish.

Shane

"jamie" <an*******@disc ussions.microso ft.com> wrote in message
news:6b******** *************** *****@phx.gbl.. .

I wish to create an array that points to, say, the middle
section of a different array.

eg
Original array >[0] [1] [2] [3] [4] [5] [6] [7]
second array-------------^
[0] [1] [2] [3] [4] [5]

Is this at all possible?? I think that it could be done in
c++, but I dont have a clue as to how to do it in vb.net
if it is even possible.

thanks for all help

Nov 20 '05 #2
Okay....

I have an array full of data that needs to be parced.
The packets inside the array are all standard, so they
have bytes in piticular areas.
Either I can calculate an offset to that piticular packet,
then the offset to a piticular byte or....

have another array pointing to the beginning of the packet.

I dont know if this makes sence.
(Im a little low on caffeen power.)
-----Original Message-----
Why would you want to do this???

Are you wanting an array of arrays or what?
Maybe telling us the application would be helpful....at least a made upapplication of what you want to accomplish.

Shane

"jamie" <an*******@disc ussions.microso ft.com> wrote in messagenews:6b******* *************** ******@phx.gbl. ..

I wish to create an array that points to, say, the middle section of a different array.

eg
Original array >[0] [1] [2] [3] [4] [5] [6] [7]
second array-------------^
[0] [1] [2] [3] [4] [5]

Is this at all possible?? I think that it could be done in c++, but I dont have a clue as to how to do it in vb.net
if it is even possible.

thanks for all help

.

Nov 20 '05 #3
"jamie" <an*******@disc ussions.microso ft.com> wrote in message
news:6b******** *************** *****@phx.gbl.. .

I wish to create an array that points to, say, the middle
section of a different array.

eg
Original array >[0] [1] [2] [3] [4] [5] [6] [7]
second array-------------^
[0] [1] [2] [3] [4] [5]

Is this at all possible?? I think that it could be done in
c++, but I dont have a clue as to how to do it in vb.net
if it is even possible.

thanks for all help


Are you using an ArrayList?

Best Regards,

Andy
Nov 20 '05 #4
no, I am not using an array list.
I dont know how much of a speed penilty there would be
by using it.
-----Original Message-----
"jamie" <an*******@disc ussions.microso ft.com> wrote in messagenews:6b******* *************** ******@phx.gbl. ..

I wish to create an array that points to, say, the middle section of a different array.

eg
Original array >[0] [1] [2] [3] [4] [5] [6] [7]
second array-------------^
[0] [1] [2] [3] [4] [5]

Is this at all possible?? I think that it could be done in c++, but I dont have a clue as to how to do it in vb.net
if it is even possible.

thanks for all help


Are you using an ArrayList?

Best Regards,

Andy
.

Nov 20 '05 #5
"jamie" <an*******@disc ussions.microso ft.com> wrote in message
news:75******** *************** *****@phx.gbl.. .
no, I am not using an array list.
I dont know how much of a speed penilty there would be
by using it.


I suspect there would be far less of a penalty than you might imagine. IME
there is not a perceptible difference, although if you are intensely
processing a couple thousand elements it might matter.

Some of what is happening here is only semantics... Since an array usually
contains more than one of something, I am a bit unclear when you say "array
pointing to the beginning of the packet". To me, that sounds like a simple
variable, not an array.

Are you wanting to treat each element of a string array as if it were itself
an array of characters?

Best Regards,

Andy
Nov 20 '05 #6
Unfortunatly I am processing potentialy quite a few
hundred mb (up to one or two gig!) of data, so yes there
could be a major speed penalty at stake.

What I mean is that I am getting data from files and
am putting it in a byte array. I'll scan throught the
byte array and find a marker character. The marker
indicates the beginning of a compleat packet.
If I could have a an array pointing to the beginning
of the new found packet, then I would not have to
calculate the offset from the beginning of the original
byte array.

does this clear things up?
-----Original Message-----
"jamie" <an*******@disc ussions.microso ft.com> wrote in messagenews:75******* *************** ******@phx.gbl. ..
no, I am not using an array list.
I dont know how much of a speed penilty there would be
by using it.

I suspect there would be far less of a penalty than you

might imagine. IMEthere is not a perceptible difference, although if you are intenselyprocessing a couple thousand elements it might matter.

Some of what is happening here is only semantics... Since an array usuallycontains more than one of something, I am a bit unclear when you say "arraypointing to the beginning of the packet". To me, that sounds like a simplevariable, not an array.

Are you wanting to treat each element of a string array as if it were itselfan array of characters?

Best Regards,

Andy
.

Nov 20 '05 #7
"jamie" <an*******@disc ussions.microso ft.com> wrote in message
news:75******** *************** *****@phx.gbl.. .
no, I am not using an array list.
I dont know how much of a speed penilty there would be
by using it.


I suspect there would be far less of a penalty than you might imagine. IME
there is not a perceptible difference, although if you are intensely
processing a couple thousand elements it might matter.

Some of what is happening here is only semantics... Since an array usually
contains more than one of something, I am a bit unclear when you say "array
pointing to the beginning of the packet". To me, that sounds like a simple
variable, not an array.

Are you wanting to treat each element of a string array as if it were itself
an array of characters?

Best Regards,

Andy
Nov 20 '05 #8
Unfortunatly I am processing potentialy quite a few
hundred mb (up to one or two gig!) of data, so yes there
could be a major speed penalty at stake.

What I mean is that I am getting data from files and
am putting it in a byte array. I'll scan throught the
byte array and find a marker character. The marker
indicates the beginning of a compleat packet.
If I could have a an array pointing to the beginning
of the new found packet, then I would not have to
calculate the offset from the beginning of the original
byte array.

does this clear things up?
-----Original Message-----
"jamie" <an*******@disc ussions.microso ft.com> wrote in messagenews:75******* *************** ******@phx.gbl. ..
no, I am not using an array list.
I dont know how much of a speed penilty there would be
by using it.

I suspect there would be far less of a penalty than you

might imagine. IMEthere is not a perceptible difference, although if you are intenselyprocessing a couple thousand elements it might matter.

Some of what is happening here is only semantics... Since an array usuallycontains more than one of something, I am a bit unclear when you say "arraypointing to the beginning of the packet". To me, that sounds like a simplevariable, not an array.

Are you wanting to treat each element of a string array as if it were itselfan array of characters?

Best Regards,

Andy
.

Nov 20 '05 #9
Then why not just open the file in binary to read it.

Read until you hit that marker....

Wouldn't that do what you want?

Shane
"jamie" <an*******@disc ussions.microso ft.com> wrote in message
news:78******** *************** *****@phx.gbl.. .
Unfortunatly I am processing potentialy quite a few
hundred mb (up to one or two gig!) of data, so yes there
could be a major speed penalty at stake.

What I mean is that I am getting data from files and
am putting it in a byte array. I'll scan throught the
byte array and find a marker character. The marker
indicates the beginning of a compleat packet.
If I could have a an array pointing to the beginning
of the new found packet, then I would not have to
calculate the offset from the beginning of the original
byte array.

does this clear things up?
-----Original Message-----
"jamie" <an*******@disc ussions.microso ft.com> wrote in

message
news:75******* *************** ******@phx.gbl. ..
no, I am not using an array list.
I dont know how much of a speed penilty there would be
by using it.


I suspect there would be far less of a penalty than you

might imagine. IME
there is not a perceptible difference, although if you

are intensely
processing a couple thousand elements it might matter.

Some of what is happening here is only semantics...

Since an array usually
contains more than one of something, I am a bit unclear

when you say "array
pointing to the beginning of the packet". To me, that

sounds like a simple
variable, not an array.

Are you wanting to treat each element of a string array

as if it were itself
an array of characters?

Best Regards,

Andy
.

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
108841
by: lawrence | last post by:
I just switched error_reporting to ALL so I could debug my site. I got a huge page full of errors. One of the most common was that in my arrays I'm using undefined offsets and indexes. These still work fine, but with error reporting at all they are marked as errors. Why? What am I doing wrong? www.monkeyclaus.org
4
2565
by: Gactimus | last post by:
Here is a program that encodes and decodes a text file. What I need to do is write a C++ program that requests 3 different file names. One filename is for the source file to be encoded, another is the name of the 'encoded' output file, and the final filename is an offset file. On a character by character basis, the program needs to look at the first character of the source file and offset it by the first character in the offset file. The...
0
5800
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ? SELECT ... ; ----> returns 100,000 rows
11
3480
by: Bradford Chamberlain | last post by:
I work a lot with multidimensional arrays of dynamic size in C, implementing them using a single-dimensional C array and the appropriate multipliers and offsets to index into it appropriately. I tend to iterate over subsets of these arrays by walking a pointer and an offset per dimension across their dimensions. I've found that this tends to result in more performance in a portable manner than doing explicit indexing calculations and...
9
2128
by: bahadir.balban | last post by:
Hi, When you define an array base with a define statement, like #define ARRAY_BASE 0x1000; and access it, such as ARRAY_BASE
8
3553
by: Bo Peng | last post by:
Dear list, I am using std::vector<bool> (bit_vector) to store my bit sequence. To access the same sequence from C (to expose to a python module), I need to know the pointer and offset of vector::<bool>::iterator (or reference). However, given a std::vector<bool> a, all a.begin(), a etc are instances of a proxy class so I can not do things like &*a.begin(). Is there a safe way to get the information I need? Many thanks in advance.
1
13054
by: Manish | last post by:
The code is as ... $folderlistfile = $path."xmlfile.xml"; /* <list> <details id="2"> <name>Books</name>
2
1668
by: Mel | last post by:
This is a long shot but here goes... I have a line that may have several bends (angles) to it. Anyone know of any tips or tricks to create the same line again but just have it offset from the original line a small amount? Example L-Shaped Line: 1" long 90 degree angle 1"long
8
4002
by: Thomas Mlynarczyk | last post by:
Hello, I want to split a given string into tokens which are defined by regexes: // example tokens - a bit more complex in real $tokens = array( 'NUMBER' ='~^\d+~', 'NAME' ='~^+~', 'ANY' ='~^.~' ); // make sure there is always a match
0
9686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9540
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10250
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.