473,497 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

array of structures question

Hi
I need help with a code snippet for the following
problem.

1. I have 2 elements , one is a datetime element and another is an integer
2. I would like to store this in a array so that for each index of the array
I can refer to the integer value or the datetime value.

I think I need some kind of structure that a 1 dimensional array can point
to
and this structure that contains the 2 data types

How can I declare this and access this structure?
Allan
Nov 21 '05 #1
3 864
Aprivate,

Nice puzzle.

Can you make it more clear, what is the integer?

Cor
Nov 21 '05 #2
"aprivate" <al***@singaporerc.com> schrieb:
1. I have 2 elements , one is a datetime element and another is an integer
2. I would like to store this in a array so that for each index of the
array
I can refer to the integer value or the datetime value.

I think I need some kind of structure that a 1 dimensional array can point
to
and this structure that contains the 2 data types

How can I declare this and access this structure?


\\\
Public Structure Item
Public StartDate As Date
Public Number As Integer
End Structure
..
..
..
Dim Items(10) As Item
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Hi
Thanks
This is what I need..!

Regds
Allan
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O%****************@TK2MSFTNGP12.phx.gbl...
"aprivate" <al***@singaporerc.com> schrieb:
1. I have 2 elements , one is a datetime element and another is an
integer
2. I would like to store this in a array so that for each index of the
array
I can refer to the integer value or the datetime value.

I think I need some kind of structure that a 1 dimensional array can
point to
and this structure that contains the 2 data types

How can I declare this and access this structure?


\\\
Public Structure Item
Public StartDate As Date
Public Number As Integer
End Structure
.
.
.
Dim Items(10) As Item
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

8
54431
by: Frank Münnich | last post by:
Hi there.. My name is Frank Münnich. I've got a question about pointers that refer to an array of a structure. How do I declare that type? If I have declared a structure struct mystruc {...
8
3661
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was...
8
2749
by: Vu Pham | last post by:
If I have sometype ar; then does the following command clear the whole array to zero ? memset( ar, 0, A*B*sizeof(sometype) ); Thanks,
4
7268
by: emma middlebrook | last post by:
Hi Straight to the point - I don't understand why System.Array derives from IList (given the methods/properties actually on IList). When designing an interface you specify a contract. Deriving...
2
2176
by: david | last post by:
Well, as a matter of fact I_HAD_MISSED a basic thing or two, anyway, although Ollie's answer makes perfectly sense when dealing with classes, it doesn't seem to me to apply as well if you have to...
104
16845
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
12
3852
by: gcary | last post by:
I am having trouble figuring out how to declare a pointer to an array of structures and initializing the pointer with a value. I've looked at older posts in this group, and tried a solution that...
11
3754
by: skumar434 | last post by:
Hi everybody, I am faceing problem while assigning the memory dynamically to a array of structures . Suppose I have a structure typedef struct hom_id{ int32_t nod_de; int32_t hom_id;
44
5726
by: svata | last post by:
Hello, I wonder how to resize such array of structures using realloc()? #include <stdio.h> #include <stdlib.h> #define FIRST 7 typedef struct { char *name;
17
2292
by: Ben Bacarisse | last post by:
candide <toto@free.frwrites: These two statements are very different. The first one is just wrong and I am pretty sure you did not mean to suggest that. There is no object in C that is the...
0
6991
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...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
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...
0
7373
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...
0
5456
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,...
1
4897
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
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 ...
0
286
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...

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.