473,511 Members | 14,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with sizeof and pointers

hello,
ok, I want to find the length of an int array that is being passed to a function:

main()
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
}
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
}
arraylen should be 8 I get 1.

What am I doing Wrong?

Thanx
Jul 19 '05 #1
33 12818
Metzen wrote:
hello,
ok, I want to find the length of an int array that is being passed to a function:
You can't pass an array to a function, at least not directly.

main()
int main()

There is no "implicit int" rule in C++, and there hasn't been for many
years.
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
This passes a pointer to the function.
}
function(int *array)
'array' is a somewhat misleading name for a pointer.
{
int arraylen = sizeof(*array)/sizeof(int);
sizeof(*array) == sizeof(int), so of course you get 1 here. But no
matter what you do, you won't get the size of the memory pointed to by
'array' using sizeof.
}
arraylen should be 8 I get 1.

What am I doing Wrong?


You need to pass the size into the function.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #2
You have two choices either end your array with a unque int or pass the
size.

main()
{
int array[]={1,2,3,4,5,6,7,8};
function (array, sizeof(array)/sizeof(int))
}

function(int *array, int size)
{
}

"Metzen" <an****@yahoo.com> wrote in message
news:4e**************************@posting.google.c om...
hello,
ok, I want to find the length of an int array that is being passed to a
function:

main()
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
}
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
}
arraylen should be 8 I get 1.

What am I doing Wrong?

Thanx
Jul 19 '05 #3
Steven C. wrote:
You have two choices


Please don't top-post. Re-read section 5 of the FAQ for posting guidelines.

http://www.parashift.com/c++-faq-lite/

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #4
In article <4e**************************@posting.google.com >,
Metzen <an****@yahoo.com> wrote:
hello,
ok, I want to find the length of an int array that is being passed to a
function:
You can't. You have to pass in the length as a separate
argument/parameter.
main()
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
}
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
}
arraylen should be 8 I get 1.

What am I doing Wrong?


You're using arrays instead of vectors.

#include <vector>

using namespace std;

void function (vector<int>& array)) // functions in C++ must have
// return types
{
int arraylen = array.size();
}

int main () // according to the C++ standard, main() must return an int.
{
vector<int> array(8);
array[0] = 1;
array[1] = 2;
// etc.
function (array);
return 0;
}

--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
Jul 19 '05 #5
Metzen escribió:
ok, I want to find the length of an int array that is being passed to afunction:

main()
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
}
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
}

arraylen should be 8 I get 1.

What am I doing Wrong?


You are using sizeof (*array), * array is equivalent in this case to
array [0], that is, an int, then you are dividing sizeof (int) by sizeof
(int).

You need something like sizeof (array) / sizeof (int), if what you
intend is obtain the number of elements in the array. Or better yet,
sizeof (array) / sizeof (* array), that will no require change if you
later change your mind and use an array of double, for example.

Regards.
Jul 19 '05 #6
> You need to pass the size into the function.
Or, if you can make some assumptions about the array, like what's the
last value in it ( like '\0' terminated c style char arrays ), you can
determine the length of the array.

-Brian
Jul 19 '05 #7
Julián Albo escribió:
main()
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
}
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
}

arraylen should be 8 I get 1.

What am I doing Wrong?


You are using sizeof (*array), * array is equivalent in this case to
array [0], that is, an int, then you are dividing sizeof (int) by sizeof
(int).

You need something like sizeof (array) / sizeof (int), if what you
intend is obtain the number of elements in the array. Or better yet,
sizeof (array) / sizeof (* array), that will no require change if you
later change your mind and use an array of double, for example.


Ops, I don't see you passed array to a function. In that case sizeof
array will give you the size of a pointer, not the size of the array.

Regards.
Jul 19 '05 #8
"Metzen" <an****@yahoo.com> wrote
hello,
ok, I want to find the length of an int array that is being passed to a

function:

The following might work. I can't work out whether the standard says it does.

// Begin listing
#include <iostream>
#include <ostream>

#define MACRO(a) (sizeof (a) / sizeof (int))

template <typename T, unsigned N>
int function (T (&) [N]) { return N; }

int test (int a [])
{
// std::cout << function (a) << ", "; // compile-time error
std::cout << MACRO (a) << std::endl; // no error signaled
}

int main ()
{
int array [] = { 1, 2, 3, 4, 5, 6, 7, 8 };

std::cout << function (array) << ", ";
std::cout << MACRO (array) << std::endl;

test (array);
}
// End listing

I get what I expected on mingw32-g++ 3.2 and on bcb32:
the output is "8, 8"; "1". Both compilers report the compile
time error marked if I uncomment that line.

So the template version is slightly superior in that, although
it only works in a small set of situations, it will not compile
unless it can give you the correct answer.

It's probably only rarely that this can be used instead of the
techniques mentioned in the other replies, and even more
rarely that it will provide any significant advantage in speed
or code size. But maybe sometimes.

Yours,
Buster.
Jul 19 '05 #9
an****@yahoo.com (Metzen) wrote in message news:<4e**************************@posting.google. com>...
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
That's the size of a pointer divided by the size of the object to
which it points, the result of which is meaningless.
}
arraylen should be 8 I get 1.

What am I doing Wrong?


You're passing a pointer, not an array. Technically, in modern C++,
you can fix the problem by passing an array by reference like this:

#include <cstddef>

// the size of an array is most properly represented by std::size_t
template <std::size_t N>
void function (int (&array) [N]) {
std::size_t arraylen = N;
}

However, that most people don't write functions like this. Rather,
they just pass in the size themselves:

void function (int *array, std::size_t arraylen) { }
function(array, sizeof(array) / sizeof(array[0]));

Perhaps you can combine the approaches:

template <typename T, std::size_t N>
std::size_t size (T (&) [N]) { return N; }
template <typename T, std::size_t N>
std::size_t size (const T (&) [N]) { return N; }
function(array, size(array));

- Shane
Jul 19 '05 #10

"Buster" <no***@nowhere.com> wrote
#define MACRO(a) (sizeof (a) / sizeof (int))


Or better,
#define MACRO(a) (sizeof (a) / sizeof * (a))

Regards.
Jul 19 '05 #11
> // Begin listing
#include <iostream>
#include <ostream>

#define MACRO(a) (sizeof (a) / sizeof (int))

template <typename T, unsigned N>
int function (T (&) [N]) { return N; }

int test (int a [])
{
// std::cout << function (a) << ", "; // compile-time error
std::cout << MACRO (a) << std::endl; // no error signaled
}

int main ()
{
int array [] = { 1, 2, 3, 4, 5, 6, 7, 8 };

std::cout << function (array) << ", ";
std::cout << MACRO (array) << std::endl;

test (array);
}
// End listing

I get what I expected on mingw32-g++ 3.2 and on bcb32:
the output is "8, 8"; "1". Both compilers report the compile
time error marked if I uncomment that line.

So the template version is slightly superior in that, although
it only works in a small set of situations, it will not compile
unless it can give you the correct answer.

It's probably only rarely that this can be used instead of the
techniques mentioned in the other replies, and even more
rarely that it will provide any significant advantage in speed
or code size. But maybe sometimes.


What happens if you do:
int main ()
{
short array [] = { 1, 2, 3, 4, 5, 6, 7, 8 };
std::cout << MACRO (array) << std::endl;
}

What if short was SomeLargeObect instead? Stroustrup advises against using
macros as they defeat the
type safety that C++ supplies. I would suggest that the template solution
is more than "slightly" superior in
that respect.
Jul 19 '05 #12
Big Brian wrote:
You need to pass the size into the function.


Or, if you can make some assumptions about the array, like what's the
last value in it ( like '\0' terminated c style char arrays ), you can
determine the length of the array.


True. That's sort of passing the size in implicitly. Passing a
std::vector (probably by reference) instead is another obvious solution,
which I didn't mention mostly because I was in a hurry. But that also
passes the size (implicitly) into the function. My statement is quite
true, but has to be taken in a very broad sense. Somehow, information
about where the array ends must be communicated to the function (and
it's not implicit in an "array argument" which is, in fact, not an array
at all).

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #13
Buster wrote:
"Metzen" <an****@yahoo.com> wrote
hello,
ok, I want to find the length of an int array that is being passed to a
function:

The following might work. I can't work out whether the standard says it does.


It absolutely will not work.

// Begin listing
#include <iostream>
#include <ostream>

#define MACRO(a) (sizeof (a) / sizeof (int))

template <typename T, unsigned N>
int function (T (&) [N]) { return N; }

int test (int a [])
The type of a is 'pointer to int'.
{
// std::cout << function (a) << ", "; // compile-time error
This didn't work because 'a' is not an array, but a pointer. You CANNOT
pass arrays to functions (directly). It always passes a pointer. Array
arguments... aren't. They are pointer arguments.
std::cout << MACRO (a) << std::endl; // no error signaled


The macro expands to

(sizeof (a) / sizeof (int))

which is equivalent to (sizeof(int*)/sizeof(int)) which does not give
the number of elements pointed to by 'a'.

I see that later you say this is the result you expected. OK, then...
but it's not an answer to the question, because it doesn't let you
determine the size of an array pointed to by a pointer argument to a
function.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #14
"Kevin Goodsell" <us*********************@neverbox.com> wrote in message
Buster wrote:
The following might work. I can't work out whether the standard says it does.

It absolutely will not work.
I think we're in agreement about what does and doesn't work. What I expected
to happen, happens. What I'm not sure of is whether what I expect is enforced
by the standard.
// std::cout << function (a) << ", "; // compile-time error


This didn't work because 'a' is not an array, but a pointer. You CANNOT
pass arrays to functions (directly). It always passes a pointer. Array
arguments... aren't. They are pointer arguments.


Yes, I know.
std::cout << MACRO (a) << std::endl; // no error signaled


The macro expands to

(sizeof (a) / sizeof (int))

which is equivalent to (sizeof(int*)/sizeof(int)) which does not give
the number of elements pointed to by 'a'.


Yes, I know. I recommended the template solution and showed
the older C-style technique for comparison. It's unfortunate that
I got the macro wrong, but there you go.
I see that later you say this is the result you expected. OK, then...
but it's not an answer to the question, because it doesn't let you
determine the size of an array pointed to by a pointer argument to a
function.
The question was "I want to find the length of an int array that is being
passed to a function". No mention of pointers there.
-Kevin

Jul 19 '05 #15

"Duane Hebert" <sp**@flarn.com> wrote
What happens if you do:
int main ()
{
short array [] = { 1, 2, 3, 4, 5, 6, 7, 8 };
std::cout << MACRO (array) << std::endl;
}
Implementation specific. But I should have had:
#define MACRO(a) (sizeof (a) / sizeof * (a))
which works in that situation.
What if short was SomeLargeObect instead?
The new MACRO would work just fine.
Stroustrup advises against using
macros as they defeat the
type safety that C++ supplies.
Quite right too, but type safety is not the issue here.
The decay of an array into a pointer is what makes
this macro dangerous.
I would suggest that the template solution
is more than "slightly" superior in
that respect.


"Slightly" is enough for me.

Thanks,
Buster.
Jul 19 '05 #16
Buster wrote:
"Kevin Goodsell" <us*********************@neverbox.com> wrote in message
Buster wrote:
The following might work. I can't work out whether the standard says it

does.
It absolutely will not work.

I think we're in agreement about what does and doesn't work. What I expected
to happen, happens. What I'm not sure of is whether what I expect is enforced
by the standard.

// std::cout << function (a) << ", "; // compile-time error


This didn't work because 'a' is not an array, but a pointer. You CANNOT
pass arrays to functions (directly). It always passes a pointer. Array
arguments... aren't. They are pointer arguments.

Yes, I know.

std::cout << MACRO (a) << std::endl; // no error signaled


The macro expands to

(sizeof (a) / sizeof (int))

which is equivalent to (sizeof(int*)/sizeof(int)) which does not give
the number of elements pointed to by 'a'.

Yes, I know. I recommended the template solution and showed
the older C-style technique for comparison. It's unfortunate that
I got the macro wrong, but there you go.

I see that later you say this is the result you expected. OK, then...
but it's not an answer to the question, because it doesn't let you
determine the size of an array pointed to by a pointer argument to a
function.

The question was "I want to find the length of an int array that is being
passed to a function". No mention of pointers there.

You may be passing an array, but by the time the function you're
calling sees it, it has decayed into a pointer.

HTH,
--ag
--
Artie Gold -- Austin, Texas

Jul 19 '05 #17
> > The question was "I want to find the length of an int array that is being
passed to a function". No mention of pointers there.

You may be passing an array, but by the time the function you're
calling sees it, it has decayed into a pointer.

Not if you pass the array by reference.

Regards,
Buster.
Jul 19 '05 #18
Buster wrote:
The question was "I want to find the length of an int array that is being
passed to a function". No mention of pointers there.


You may be passing an array, but by the time the function you're
calling sees it, it has decayed into a pointer.


Not if you pass the array by reference.


OK, I'm intrigued.
Example code?

Cheers,
--ag

--
Artie Gold -- Austin, Texas

Jul 19 '05 #19
"Artie Gold" <ar*******@austin.rr.com> wrote
You may be passing an array, but by the time the function you're
calling sees it, it has decayed into a pointer.


Not if you pass the array by reference.


OK, I'm intrigued.
Example code?


I already posted some. Shane Beasley's post has examples too.

Yours,
Buster.
Jul 19 '05 #20
Buster wrote:
"Kevin Goodsell" <us*********************@neverbox.com> wrote in message
It absolutely will not work.

I think we're in agreement about what does and doesn't work. What I expected
to happen, happens. What I'm not sure of is whether what I expect is enforced
by the standard.


I should have removed that line from my post when I realized what you
were doing.


The question was "I want to find the length of an int array that is being
passed to a function". No mention of pointers there.


But an array cannot be (directly) passed to a function. I think the
template and/or reference solution seems unlikely to work well in
practice. When dealing with "arrays", one often actually deals with
pointers (because it was passed from elsewhere, or dynamically allocated).

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #21
Buster wrote:
"Artie Gold" <ar*******@austin.rr.com> wrote
You may be passing an array, but by the time the function you're
calling sees it, it has decayed into a pointer.

Not if you pass the array by reference.


OK, I'm intrigued.
Example code?

I already posted some. Shane Beasley's post has examples too.

Unless I'm missing something (not terribly unlikely), all the
examples provided only work when the actual array is in scope
at the point where its size is being asked (which means that
the size would be known anyway).

BTW - there's no flame intended here at all.

Cheers,
--ag

--
Artie Gold -- Austin, Texas

Jul 19 '05 #22
> > What happens if you do:
int main ()
{
short array [] = { 1, 2, 3, 4, 5, 6, 7, 8 };
std::cout << MACRO (array) << std::endl;
}


Implementation specific. But I should have had:
#define MACRO(a) (sizeof (a) / sizeof * (a))
which works in that situation.


I'm curious. Why not just use std::vector<int>?
Jul 19 '05 #23

"Kevin Goodsell" <us*********************@neverbox.com> wrote
The question was "I want to find the length of an int array that is being
passed to a function". No mention of pointers there.
But an array cannot be (directly) passed to a function.


You've got me there. Indirection is required, although in this case
it's penalty-free and pretty much a syntactic thing.
I think the
template and/or reference solution seems unlikely to work well in
practice. When dealing with "arrays", one often actually deals with
pointers (because it was passed from elsewhere, or dynamically allocated).


Agreed, with reservations. The template I gave (or one of Shane's) works
when it works and doesn't do any harm.

IIRC, reference-to-array function parameters are not well supported on
certain compilers (*cough* borland) and can decay into a pointer to the
first element. That's another reason to be careful with them.

Regards,
Buster
Jul 19 '05 #24
"Duane Hebert" <sp**@flarn.com> wrote
I'm curious. Why not just use std::vector<int>?


I don't recall mentioning vector. Go with it if it
does what you need.

Good luck,
Buster.
Jul 19 '05 #25

"Artie Gold" <ar*******@austin.rr.com> wrote
Unless I'm missing something (not terribly unlikely), all the
examples provided only work when the actual array is in scope
at the point where its size is being asked (which means that
the size would be known anyway).
No, you're quite right. As others have said, it's not terribly useful.
But I have found something like the following handy in the past, to
save a little typing.

template <typename U, typename V, std::size_t N>
U (& u) [N] add (U (& u) [N], V (& v) [N])
{
for (std::size_t i = 0; i != N; ++ i) u += v;
return u;
}
BTW - there's no flame intended here at all.


None taken; likewise.

Buster.
Jul 19 '05 #26
Buster wrote:
"Artie Gold" <ar*******@austin.rr.com> wrote
Unless I'm missing something (not terribly unlikely), all the
examples provided only work when the actual array is in scope
at the point where its size is being asked (which means that
the size would be known anyway).

No, you're quite right. As others have said, it's not terribly useful.
But I have found something like the following handy in the past, to
save a little typing.

template <typename U, typename V, std::size_t N>
U (& u) [N] add (U (& u) [N], V (& v) [N])
{
for (std::size_t i = 0; i != N; ++ i) u += v;
return u;
}

BTW - there's no flame intended here at all.

None taken; likewise.


Oh. Well. OK then!

Cheers,
--ag
--
Artie Gold -- Austin, Texas

Jul 19 '05 #27
I'm curious what news reader program u use that is better with bottom
posting.
"Kevin Goodsell" <us*********************@neverbox.com> wrote in message
news:%K****************@newsread4.news.pas.earthli nk.net...
Steven C. wrote:
You have two choices


Please don't top-post. Re-read section 5 of the FAQ for posting guidelines.

http://www.parashift.com/c++-faq-lite/

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
Jul 19 '05 #28
Steven C. wrote:
I'm curious what news reader program u use that is better with bottom
posting.


Correct posting does not depend on the news client. Please read the
following:

http://www.cs.tut.fi/~jkorpela/usenet/brox.html
http://www.caliburn.nl/topposting.html
http://www.dickalba.demon.co.uk/usen.../faq_topp.html

Top-posting is wrong. It violates internet standards. It's illogical. It
encourages over-quoting. You've been asked not to do it. If you have a
problem with that, I suggest you find a group that doesn't care how you
post. Here, we insist on proper posting (for many reasons).

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #29
Steven C. wrote:
I'm curious what news reader program u use that is better with bottom
posting.


Steven!

I see you are using OutOfLuck Express (like I do). Look at this:

http://home.in.tum.de/~jain/software/oe-quotefix/

There you find a free (and good) little proggy, which will help you to make
proper posting with no effort. It fixes the non-standard Microsoft way of
quoting.

--
WW aka Attila
Jul 19 '05 #30
Chill out I just asked! I guess it's kind of a religious thing with you.
Jul 19 '05 #31
Steven C. wrote:
Chill out I just asked! I guess it's kind of a religious thing with you.


Please quote some context when replying. Assuming your reply was meant
for me, here's my response.

I read usenet a lot. I actively participate in groups, and I frequently
search the archives for information. Correct posting makes everything go
much more smoothly. It avoids confusion and misunderstandings, and keeps
the discussion organized and easy to follow. It also prevents wasted
time and space caused by overquoted replies. Isn't that worth a little
tiny bit of extra effort, especially considering 1) the size of the
audience (potentially thousands) and 2) the lifetime of the articles
(maybe forever)?

It's not as if these are arbitrary rules. They have a purpose, and were
determined to be the best practices based on experience.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #32
In article <Nf*********************@twister.socal.rr.com>,
Steven C. <no****@xxx.com> wrote:
I'm curious what news reader program u use that is better with bottom
posting.


Actually, even with Outlook Express it's easy to post "properly". All you
have to do is start at the top where OE puts you to begin with, and scroll
down through the quoted text. As you go, delete the stuff that isn't
directly relevant to your response. When you come to a point that you
want to respond to, stop scrolling and put your comments after that point.
Then, if you're not at the end of the message yet, keep scrolling and
deleting, and inserting more comments if appropriate. Eventually you'll
reach the bottom, and your comments will be interspersed nicely among the
remaining quoted material, point/counterpoint style.

With this procedure, it's actually *better* to have the cursor at the top
to begin with. If the cursor starts out at the bottom, you have to scroll
all the way up to the top before you can start working your way down.

--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
Jul 19 '05 #33
On Sat, 13 Sep 2003 03:59:46 GMT, "Steven C." <no****@xxx.com> wrote
in comp.lang.c++:
You have two choices either end your array with a unque int or pass the
size.

main()
{
int array[]={1,2,3,4,5,6,7,8};
function (array, sizeof(array)/sizeof(int))
}

function(int *array, int size) ^^^

function(int *array, size_t size) {
}

"Metzen" <an****@yahoo.com> wrote in message
news:4e**************************@posting.google.c om...
hello,
ok, I want to find the length of an int array that is being passed to a
function:

main()
{
int array[]={1,2,3,4,5,6,7,8};
function(array);
}
function(int *array)
{
int arraylen = sizeof(*array)/sizeof(int);
}
arraylen should be 8 I get 1.

What am I doing Wrong?

Thanx


Jul 19 '05 #34

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

Similar topics

5
3520
by: ArShAm | last post by:
Hi there Please help me to optimize this code for speed I added /O2 to compiler settings I added /Oe to compiler settings for accepting register type request , but it seems that is not allowed...
5
2512
by: Sona | last post by:
I understand the problem I'm having but am not sure how to fix it. My code passes two char* to a function which reads in some strings from a file and copies the contents into the two char*s. Now...
27
4710
by: MK | last post by:
I am a newbie. Please help. The following warning is issued by gcc-3.2.2 compiler (pc Linux): ================================================================== read_raw_data.c:51: warning:...
2
1795
by: leo2100 | last post by:
Hi, I need help with this program. The program is supposed to take a text file and identify the words in it, then it should print them and count how many times a word is repeated. At first main...
23
2501
by: vinod.bhavnani | last post by:
Hello all, I need desperate help Here is the problem: My problem today is with multidimensional arrays. Lets say i have an array A this is a 4 dimensional static array.
9
1672
by: Andreas Vinther | last post by:
I have a small piece of code that compiles but does not perform like I want it to. This code works: ---------------- void *y0; void *y1; void *y2; void *y3;
38
2560
by: James Brown | last post by:
All, I have a quick question regarding the size of pointer-types: I believe that the sizeof(char *) may not necessarily be the same as sizeof(int *) ? But how about multiple levels of pointers...
4
2493
by: Christian Maier | last post by:
Hi After surfing a while I have still trouble with this array thing. I have the following function and recive a Segmentation fault, how must I code this right?? Thanks Christian Maier
3
1417
by: Jim | last post by:
Ok, I'm having 'fun' with pointers to structures. I've got some code that looks something like this: ==================== typedef struct { unsigned long *clno, *lastHistoryRecord; } aRecord;
9
1911
by: xiao | last post by:
It always dumped when I tried to run it... But it compiles OK. What I want to do is to do a test: Read information from a .dat file and then write it to another file. The original DAT file is...
0
7237
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,...
0
7349
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
7417
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...
1
7074
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...
0
5659
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,...
0
3219
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...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
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.