473,587 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Two dimentional array dereference in C

Hi All,

We know the following facts,

1. A two dimentional arrays in C is stored similar to a single
dimentional array.
2. * is the dereference operator that gives value at address denoted
by the operand to this operator. i.e *p is the value at address given
by p.
3. In case of two dimentional array a[][], a+1 refers to the second
row, and a+3 refers to the fourth row.
4. *(derefernce) operator has higher precedence that + operator.

So lets look at the following program...

1 #include<stdio. h>
2 int main()
3 {
4 int p[5][5];
5 p[0][0]=4;
6 p[2][0]=5;
7 p[2][3]=6;
8 printf("\n%d", *(*(p+2)+3));
9 printf("\n%d", *(*(p+2)));
10 printf("\n%d", *(*p+0));
11 }
Out put of this program compiled in gcc 3.4.2 is

6
5
4

Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address and points to p[0]
[0]; according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].
According to fact 2, * operator on this should give the value at
address denoted by p[2][0], so *(p+2) should be 5; then again +3, that
is, total is 8 and the first * on this...so it should not give the
appropriate result.

But it gives !

So, what is that second * in the expression *(*(p+2)+3)) doing?
Does the meaning of this second * is "value at..." or something else?

[The other two lines numbered 9, 10 in the program is just for
reference]

With regards.
Srinu
Nov 19 '07 #1
9 2453
On Nov 19, 12:01 pm, Srinu <sinu.nayak2... @gmail.comwrote :
Hi All,

We know the following facts,

1. A two dimentional arrays in C is stored similar to a single
dimentional array.
2. * is the dereference operator that gives value at address denoted
by the operand to this operator. i.e *p is the value at address given
by p.
3. In case of two dimentional array a[][], a+1 refers to the second
row, and a+3 refers to the fourth row.
4. *(derefernce) operator has higher precedence that + operator.

So lets look at the following program...

1 #include<stdio. h>
2 int main()
3 {
4 int p[5][5];
5 p[0][0]=4;
6 p[2][0]=5;
7 p[2][3]=6;
8 printf("\n%d", *(*(p+2)+3));
9 printf("\n%d", *(*(p+2)));
10 printf("\n%d", *(*p+0));
11 }

Out put of this program compiled in gcc 3.4.2 is

6
5
4

Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address and points to p[0]
[0]; according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].
According to fact 2, * operator on this should give the value at
address denoted by p[2][0], so *(p+2) should be 5; then again +3, that
is, total is 8 and the first * on this...so it should not give the
appropriate result.

But it gives !

So, what is that second * in the expression *(*(p+2)+3)) doing?
Does the meaning of this second * is "value at..." or something else?

[The other two lines numbered 9, 10 in the program is just for
reference]

With regards.
Srinu
Hi Srinu,

Did you check what are the values of the memory pointers, I check it
with gdb and it was like following.
For clarity I m showing only the last two digits

p 0x00

*p 0x00
*p+1 0x04
*p+2 0x08
*p+3 0x0c
*p+4 0xa0

p+1 0xa4 ( == *p +5 )

*(p+1) 0xa4
*(p+1)+1 0xa8
*(p+1)+2 0xac
*(p+1)+3 0xb0
*(p+1)+4 0xb4

p+2 0xb8

*(p+2) 0xb8
*(p+2)+1 0xbc
*(p+2)+2 0xc0
*(p+2)+3 0xc4
*(p+2)+4 0xc8
and so on.
So as you said the 2-D array is stored as a 1-D array in the memory
space. But the fact is when it is accessing through referencing it
shows the following behaviors.

when we say (p + 1), actually we are increasing the p memory pointer
with (5 * sizeof(int)) , that is the compiler keeps p as a pointer of
2-D array.

when we say (*p +1), actually we are increasing *p by sizeof(int),
that is *p is like a pointer of 1-D array.

and p, p+1, p +2, .. p+4 points to the value which is same as their
address,
i.e. *p == p and *(p+1) == (p+1) like that.

but *p = p here doesn't imply **p = *p, because here **p = p[0][0],

I think this is a trick whenever you want to access p[x][y] from p
which is declared as int p[n][m] the following operation.

*(*(p+x)+y) works.

And whenever i want to allocate 2-D array dynamically,
I can declare the memeory space like in the following, (Here memory is
not a 1-D array)

int **p = (int**)malloc(s izeof(int*)*n);
int i;
for(i = 0; i < n; i ++)
{
p[i] = (int*)malloc(si zeof(int)*m);
}

Still I can use p[x][y] to access the exact content, because it is
interpreted as *(*(p+x)+y).
So I think the behavior you were talking about is a hack in c. If
there is some better logical explanation to this, Please correct me.
Thanks
Dimuthu
Nov 19 '07 #2
Srinu wrote:
Hi All,

We know the following facts,

1. A two dimentional arrays in C is stored similar to a single
dimentional array.
2. * is the dereference operator that gives value at address denoted
by the operand to this operator. i.e *p is the value at address given
by p.
3. In case of two dimentional array a[][], a+1 refers to the second
row, and a+3 refers to the fourth row.
4. *(derefernce) operator has higher precedence that + operator.

So lets look at the following program...

1 #include<stdio. h>
2 int main()
3 {
4 int p[5][5];
5 p[0][0]=4;
6 p[2][0]=5;
7 p[2][3]=6;
8 printf("\n%d", *(*(p+2)+3));
*(p+2) means exactly the same thing as p[2]. *(p[2]+3) means exactly the
same thing as p[2][3]. Therefore, this should print out 6.
9 printf("\n%d", *(*(p+2)));
Same as p[2][0]
10 printf("\n%d", *(*p+0));
Same as p[0][0]
11 }
Out put of this program compiled in gcc 3.4.2 is

6
5
4
Exactly as expected.
>
Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address and points to p[0]
[0]; according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].
One of the subtle details about C is the fact that it doesn't really
have multi-dimensional arrays. What it has is one-dimensional arrays
whose element type can also be an array. The array p contains 5 elements
(not 25). Each of those elements is itself an array of 5 ints. That
distinction may seem like sheer pedanticism, but understanding it is
essential to understanding some features of C, as your question
demonstrates.

In this context, as in many others, an array decays into a pointer to
it's own first element, which is p[0], an array containing 5 ints.
Therefore, p+2 points at p[2], another array containing 5 ints.
According to fact 2, * operator on this should give the value at
address denoted by p[2][0], so *(p+2) should be 5; then again +3, that
When you apply the dereferencing operator '*' to a pointer, you get a
value of the type that is pointed at. p+2 has the type "pointer to an
array of 5 ints". Therefore, when you dereference it, you don't get an
int, you get an array of 5 ints. In this context, that array decays into
a pointer to it's first element, which is p[2][0]. Therefore, when you
add 3 to it, you get a pointer to it's fourth element, p[2][3].
Dereferencing that pointer gives the value you stored in that location,
which was 6.
is, total is 8 and the first * on this...so it should not give the
If you had been correct, the number 8 would not have been something you
could safely apply the * operator to.
appropriate result.

But it gives !

So, what is that second * in the expression *(*(p+2)+3)) doing?
Does the meaning of this second * is "value at..." or something else?
Yes, it means the value at the location pointed at by it's right
operand, in this case *(p+2)+3. That expression points at p[2][3], so
*(*(p+2)+3) is p[2][3].
Nov 19 '07 #3
In article <71************ *************** *******@s6g2000 prc.googlegroup s.com>
Srinu <si************ @gmail.comwrote :
[snippage]
4 int p[5][5];
[snippage]
8 printf("\n%d", *(*(p+2)+3));
Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address
Yes ...
>and points to p[0][0];
Sort of, but not quite. The "value" of p (p when converted from
lvalue, or "object", to value) is a pointer value, pointing to the
first element of the array "p", i.e., the entire first row. In
that sense, "the value of p" points not to p[0][0] alone, but rather
to *five* "int"s p[0][0], p[0][1], p[0][2], p[0][3], and p[0][4],
all simultaneously. See also <http://web.torek.net/torek/c/pa.html>.
>according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].
Here, p+2 is definitely a value, not an object, so we need not
worry about the distinction between objects ("lvalues") and values.

Again, it refers to the *entire* row -- not *just* p[2][0], but
rather all five array elements p[2][0] through p[2][4] inclusive.
It is only once you follow this pointer value to the entire array, then
convert this array to a value, that it stops referring to the entire
row, and starts referring only to the single int p[2][0].
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 19 '07 #4
On Sun, 18 Nov 2007 23:01:48 -0800 (PST), Srinu
<si************ @gmail.comwrote :
>Hi All,

We know the following facts,

1. A two dimentional arrays in C is stored similar to a single
dimentional array.
For some meaning of the word similar.
>2. * is the dereference operator that gives value at address denoted
by the operand to this operator. i.e *p is the value at address given
by p.
Sometimes the value is an aggregate.
>3. In case of two dimentional array a[][], a+1 refers to the second
row, and a+3 refers to the fourth row.
For some meaning of refers.
>4. *(derefernce) operator has higher precedence that + operator.

So lets look at the following program...

1 #include<stdio. h>
2 int main()
3 {
4 int p[5][5];
5 p[0][0]=4;
6 p[2][0]=5;
7 p[2][3]=6;
8 printf("\n%d", *(*(p+2)+3));
9 printf("\n%d", *(*(p+2)));
10 printf("\n%d", *(*p+0));
11 }
Out put of this program compiled in gcc 3.4.2 is

6
5
4

Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address and points to p[0]
p is an array. It is not an address nor is it a pointer.
>[0]; according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].
Except for three conditions which don't apply, an expression with
array type is converted to the address of the first element with type
pointer to element type. In this case p converts to the address of
p[0] with type pointer to array of 5 int. This happens to be the same
address as &p[0][0] but a completely different type.

p+2 points to the third row. *(p+2) IS the third row. *(p+2)+3
points to the fourth element of that row. *(*(p+2)+3) is that
element.
>According to fact 2, * operator on this should give the value at
address denoted by p[2][0], so *(p+2) should be 5; then again +3, that
No! According to fact 2, *(p+2) should evaluate to the entire array
p[2]. In fact, there is a statement in the standard that says p[i] is
identical to *(p+i) (which is also identical to *(i+p) which is in
turn identical to i[p]).
>is, total is 8 and the first * on this...so it should not give the
No, the +3 merely moves you along to the address of the fourth element
in p[2].
>appropriate result.

But it gives !

So, what is that second * in the expression *(*(p+2)+3)) doing?
Each asterisk in the expression means exactly the same thing each
time, namely evaluate to the object pointed to.
>Does the meaning of this second * is "value at..." or something else?

[The other two lines numbered 9, 10 in the program is just for
reference]

Remove del for email
Nov 20 '07 #5
On Nov 20, 4:15 am, Chris Torek <nos...@torek.n etwrote:
In article <718509c3-4627-4cd0-bab1-ae84d4856...@s6 g2000prc.google groups.com>Srin u <sinu.nayak2... @gmail.comwrote :

[snippage]
4 int p[5][5];
[snippage]
8 printf("\n%d", *(*(p+2)+3));
Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address

Yes ...
and points to p[0][0];

Sort of, but not quite. The "value" of p (p when converted from
lvalue, or "object", to value) is a pointer value, pointing to the
first element of the array "p", i.e., the entire first row. In
that sense, "the value of p" points not to p[0][0] alone, but rather
to *five* "int"s p[0][0], p[0][1], p[0][2], p[0][3], and p[0][4],
all simultaneously. See also <http://web.torek.net/torek/c/pa.html>.
according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].

Here, p+2 is definitely a value, not an object, so we need not
worry about the distinction between objects ("lvalues") and values.

Again, it refers to the *entire* row -- not *just* p[2][0], but
rather all five array elements p[2][0] through p[2][4] inclusive.
It is only once you follow this pointer value to the entire array, then
convert this array to a value, that it stops referring to the entire
row, and starts referring only to the single int p[2][0].
--
I am just getting confused here.
If p points to all the 5 element of the first row why the sizeof(p) is
100 ?
Where sizeof(int) is 4 ?
And sizeof(p+2) is equal to 4 ?

Please look at the program bellow

#include<stdio. h>
int main(void)
{
int p[5][5];
printf("\n size of p = %d \n",(int)sizeof (p ));
printf("\n sizeof p+2 = %d \n",(int)sizeof (p + 2 ));
return 0;
}
Output is
size of p = 100

sizeof p+2 = 4
If p points to the first row will it size not be 5*sizeof(int) ?
Nov 20 '07 #6
somenath <so*********@gm ail.comwrites:
On Nov 20, 4:15 am, Chris Torek <nos...@torek.n etwrote:
>In article <718509c3-4627-4cd0-bab1-ae84d4856...@s6 g2000prc.google groups.com>Srin u <sinu.nayak2... @gmail.comwrote :

[snippage]
4 int p[5][5];
<snip>
>Sort of, but not quite. The "value" of p (p when converted from
lvalue, or "object", to value) is a pointer value, pointing to the
first element of the array "p", i.e., the entire first row. In
that sense, "the value of p" points not to p[0][0] alone, but rather
to *five* "int"s p[0][0], p[0][1], p[0][2], p[0][3], and p[0][4],
all simultaneously. See also <http://web.torek.net/torek/c/pa.html>.
>according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].

Here, p+2 is definitely a value, not an object, so we need not
worry about the distinction between objects ("lvalues") and values.

Again, it refers to the *entire* row -- not *just* p[2][0], but
rather all five array elements p[2][0] through p[2][4] inclusive.
It is only once you follow this pointer value to the entire array, then
convert this array to a value, that it stops referring to the entire
row, and starts referring only to the single int p[2][0].

I am just getting confused here.
If p points to all the 5 element of the first row why the sizeof(p) is
100 ?
Where sizeof(int) is 4 ?
And sizeof(p+2) is equal to 4 ?
6.3.2.1 p3:

Except when it is the operand of the sizeof operator or the unary &
operator, or is a string literal used to initialize an array, an
expression that has type ‘‘array of type’’ is converted to an
expression with type ‘‘pointer to type’’ that points to the initial
element of the array object and is not an lvalue.
>
Please look at the program bellow

#include<stdio. h>
int main(void)
{
int p[5][5];
printf("\n size of p = %d \n",(int)sizeof (p ));
printf("\n sizeof p+2 = %d \n",(int)sizeof (p + 2 ));
return 0;
}
Output is
size of p = 100

sizeof p+2 = 4
'sizeof p' gives the size of the array 'p' -- the conversion to
pointer does not happen when the expression is the operand of sizeof.

The expression 'p + 2' first involves converting p to a pointer to an
array of 5 ints. Adding 2 has no effect on the type -- the type of
the expression 'p + 2' is still a pointer type not an array type.
Applying sizeof has no special effect here -- the operand does not
have an array type.

--
Ben.
Nov 20 '07 #7
somenath wrote:
....
I am just getting confused here.
If p points to all the 5 element of the first row why the sizeof(p) is
100 ?
6.3.2.1p3:
"Except when it is the operand of the sizeof operator or the unary &
operator, or is a string literal used to initialize an array, an
expression that has type ‘‘array of type’’ is converted to an expression
with type ‘‘pointer to type’’ that points to the initial element of
the array object and is not an lvalue."

This conversion is commonly referred to as "decaying". It doesn't happen
in sizeof(p), but it does happen in p[2] and in *(p+2), both of which
mean exactly the same thing.
Where sizeof(int) is 4 ?
And sizeof(p+2) is equal to 4 ?
As indicated above, in an additive expression like p+2, p decays to a
pointer type. This is not covered by the exception for the sizeof
operator mentioned above, because that exception only applies when the
operand of sizeof has an array type. The operand is p+2, not p, and p+2
has a pointer type.
Nov 20 '07 #8
[We are given an array object named "p" -- which is not the best
name for an array, but never mind that :-) -- where p has type
(int [5][5]).]
>On Nov 20, 4:15 am, Chris Torek <nos...@torek.n etwrote:
>>... The "value" of p (p when converted from lvalue, or "object",
to value) is a pointer value, pointing to the first element of the
>>array "p", i.e., the entire first row. ...
In article <71************ *************** *******@d4g2000 prg.googlegroup s.com>
somenath <so*********@gm ail.comwrote:
>I am just getting confused here.
If p points to all the 5 element of the first row why the sizeof(p) is
100 ?
The sizeof operator suppresses object-to-value conversion.

In *most*, but definitely NOT all, contexts, an object of type
"array N of T" becomes a value of type "pointer to T", where N
is the size of the array and T is the type of the array elements.
In this case, N is 5, and T is (int [5]), or "array 5 of int".

The sizeof operator is one of those exceptions. The unary "&"
(address-of) operator is another. In both cases, applying these
operators to an array leaves the array as an array, and finds the
size of the array, or the address of the array, respectively.

The size of the array "p" is the size of 5 arrays of 5 arrays of
"int". If sizeof(int) == 4:
>Where sizeof(int) is 4 ?
then (sizeof p) is 100 (5 * 5 * 4).
>And sizeof(p+2) is equal to 4 ?
In this case, the operand of sizeof is p+2 -- not p -- so the
binary "+" operator gets the first crack at things. The binary
+ operator is one of the usual cases (remember, sizeof is one of
the UN-usual cases), so that we go from array object to pointer
value. Here we get the "value" of p, via The Rule about arrays
and pointers in C, so we have a pointer to the entire first row
of the array "p" (i.e., all of p[0]). The binary + operator moves
forward two rows, giving a pointer of type "int (*)[5]", pointing
to the third row of the array "p" (i.e., all of p[2]).

The sizeof operator thus has, as its operand, a value of type
"pointer to array 5 of int" (int (*)[5]); the size of such a pointer
is up to the compiler and/or machine, and in your case, is 4. (On
some machines this pointer has size 2 or 8; on a few, it even has
size 1. For instance, some DSP C compilers have 32-bit "C bytes".)

For additional illustration and/or confusion, try:

sizeof (&p)
sizeof (int (*)[5][5]) /* same as sizeof &p */

sizeof (int [5][5]) /* same as sizeof p */

sizeof (int (*)[5]) /* same as sizeof (p+0) or sizeof (p+i) */

sizeof (p[0])
sizeof (*p) /* same as sizeof p[0] */
sizeof (int [5]) /* same as sizeof p[0] */

The binding of the various operators is such that you can write
"sizeof &p" or "sizeof p[0]" without parentheses; however, note
that "sizeof (p + 0)" differs from "sizeof p + 0" because the
latter parses the same as "(sizeof p) + 0".

All of this makes more sense mentally, at least to me, if you
rewrite all your use of "p" (and this article) to use the name
"arr" instead.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 20 '07 #9
On Tue, 20 Nov 2007 00:50:39 -0800 (PST), somenath
<so*********@gm ail.comwrote:
>On Nov 20, 4:15 am, Chris Torek <nos...@torek.n etwrote:
>In article <718509c3-4627-4cd0-bab1-ae84d4856...@s6 g2000prc.google groups.com>Srin u <sinu.nayak2... @gmail.comwrote :

[snippage]
4 int p[5][5];
[snippage]
8 printf("\n%d", *(*(p+2)+3));
Discussion on line number 8 :
-------------------------------------------
In expression *(*(p+2)+3)), p is the base address

Yes ...
>and points to p[0][0];

Sort of, but not quite. The "value" of p (p when converted from
lvalue, or "object", to value) is a pointer value, pointing to the
first element of the array "p", i.e., the entire first row. In
that sense, "the value of p" points not to p[0][0] alone, but rather
to *five* "int"s p[0][0], p[0][1], p[0][2], p[0][3], and p[0][4],
all simultaneously. See also <http://web.torek.net/torek/c/pa.html>.
>according to fact 3, (p+2) refers to third rowof p, i.e. p[2][0].

Here, p+2 is definitely a value, not an object, so we need not
worry about the distinction between objects ("lvalues") and values.

Again, it refers to the *entire* row -- not *just* p[2][0], but
rather all five array elements p[2][0] through p[2][4] inclusive.
It is only once you follow this pointer value to the entire array, then
convert this array to a value, that it stops referring to the entire
row, and starts referring only to the single int p[2][0].
--

I am just getting confused here.
The confusion is between the object p and the expression p.
>If p points to all the 5 element of the first row why the sizeof(p) is
100 ?
There are three exceptions where an expression of type array is not
converted to pointer to the first element of the array. One of them
is when it is the operand of the sizeof operator. Therefore, sizeof p
refers to the entire array which has 5 elements, each of which
contains 5 int. Since sizeof(int) is 4, you get 100 for the 25 int
involved.

But the expression p, when not covered by an exception, is converted
to &p[0]. This is the address of the entire array of 5 int. As
usual, the address refers only to the first byte of the array but
sizeof p[0] is 20 in this example for the same reason described above.
>Where sizeof(int) is 4 ?
And sizeof(p+2) is equal to 4 ?
Your compiler is interpreting p+2 is a pointer expression and sizeof
is evaluating the size of the pointer.
>
Please look at the program bellow

#include<stdio .h>
int main(void)
{
int p[5][5];
printf("\n size of p = %d \n",(int)sizeof (p ));
printf("\n sizeof p+2 = %d \n",(int)sizeof (p + 2 ));
return 0;
}
Output is
size of p = 100

sizeof p+2 = 4
If p points to the first row will it size not be 5*sizeof(int) ?

Remove del for email
Nov 21 '07 #10

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

Similar topics

2
2219
by: Cedric Baelemans | last post by:
Hi, I try to store a two-dimentional array in a session variable. When I do the same with a one-dimentional array, it works fine, but with a two-dimentional array it fails. Is this not possible? Is there something special I have to take into account? Any help is welcome Cedric
8
5128
by: Al | last post by:
I'd like to declare (in a Matrix class) a two-dimentional array with user-defined coordinates. The constructor is: Matrix(int c, int l): col(c), lin(l), a(new float) {} the compiler says 'lin' should be a constant, but I want it to be defined from the user, so what should I do? and how must 'a' be declared?? help me please
1
3237
by: rkmoray | last post by:
I have created a Multi Dimentional array, but having problems filling it. int mCount=0; mCount=ds.Tables.Rows.Count; string arrayppsa = new string ; DataTable myDataTable=ds.Tables; foreach(DataRow myDataRow in myDataTable.Rows) {
0
2456
by: Max M. Power | last post by:
I'm getting an InvalidOperationException calling Invoke with a method parameter object array that contains a two dimentional string array. More stack trace output below: // Create two dimentional array. System::String* tda = new System::String*; tda = "lastName"; tda = "Power"; tda = "firstName"; tda = "Max";
14
2337
by: ranjmis | last post by:
Hi all, Below is the code wherein I am initializing double dimentional array inside main with string literals. Now I want to display the strings using a function call to which I just want to pass the array as argument with no other info like number of strings. Is there a way to achieve that?
2
2413
by: Icarus27 | last post by:
Hello, I am making a program that runs off of a two dimentional array but I have made it into a game called MouseBot. I am trying to make the game so that you can move the mouse until you get the cheese. It has four different difficulty levels and you have obsticles in your way (the amount depends on the difficulty level). The problem I am...
11
13421
by: rayreeves | last post by:
How do I declare an array of references to the elements of an array of values? Ray
3
2436
by: cmdolcet69 | last post by:
I can the following error message "value of type byte cannot be converted to 1-dimentional array of byte" when i execute this line of code: moRS232.Write(Packet(i)) it underline the packet(i) this is my declared array of byte size (6)
3
2416
by: neovantage | last post by:
Hey all, I need to sort 2 dimentional array. My data is in this form arrayName = decimal value say 1 arrayName = name say abc arrayName = decimal value say 2 arrayName = name say def arrayName = decimal value say 3 arrayName = name say xyz
0
7920
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...
0
8347
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...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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...
0
6626
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...
1
5718
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...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1189
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...

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.