473,396 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

printing values of "arrays of pointers"

PURPOSE: see the comments.
WHAT I GOT: infinite loop

/* This program will simply create an array of pointers to integers
* and will fill it with some values while using malloc to create
* pointers to fill the array and then will print the values pointed
* by those pointers
*
*/

#include <stdio.h>
#include <stdlib.h>

enum MAXSIZE { ARRSIZE = 100 };
int main( void )
{
int* arr_p[ARRSIZE];
int** pp;
int *mp, *np;
int i;

int null_int = 0;

pp = arr_p;
np = &null_int;
for( i = 0; i < ARRSIZE - 1; ++i )
{
mp = malloc( sizeof( int ) );
mp = &i;
arr_p[i] = mp;
}
arr_p[i] = np;

while( **pp )
{
printf("**pp = %d\n", **pp);
}

return 0;
}

--
http://lispmachine.wordpress.com/
my email ID is @ the above address

Jun 27 '08 #1
24 2144
arnuld said:
PURPOSE: see the comments.
WHAT I GOT: infinite loop

/* This program will simply create an array of pointers to integers
* and will fill it with some values while using malloc to create
* pointers to fill the array and then will print the values pointed
* by those pointers
*
*/

#include <stdio.h>
#include <stdlib.h>

enum MAXSIZE { ARRSIZE = 100 };
int main( void )
{
int* arr_p[ARRSIZE];
int** pp;
int *mp, *np;
int i;

int null_int = 0;

pp = arr_p;
np = &null_int;
for( i = 0; i < ARRSIZE - 1; ++i )
{
mp = malloc( sizeof( int ) );
You don't check to see whether this fails to allocate the requested
memory...
mp = &i;
....which doesn't really matter, since you throw it away here.
arr_p[i] = mp;
}
Well done. You just filled arr_p with a bunch of pointers to i. Why bother
with the malloc call, then? You could save yourself (ARRSIZE-1) *
sizeof(int) bytes of memory leak by removing the malloc call completely.
arr_p[i] = np;

while( **pp )
pp has the value &arr_p[0], so **pp attempts to find the int value at
*arr_p[0]. Since arr_p[0] points to i, we're looking for the value of i.
That value is indeterminate, because the object i never had a value
assigned to it. Thus, the behaviour is undefined. This loop could execute
forever (the most likely possibility) or not at all (probably the second
most likely) or something completely weird could happen.
{
printf("**pp = %d\n", **pp);
}
You don't even /try/ to iterate through the array, do you? You might want
to take a long hard look at Visual Basic or RCX.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 27 '08 #2
On Fri, 02 May 2008 13:44:50 +0000, Richard Heathfield wrote:

> for( i = 0; i < ARRSIZE - 1; ++i )
{
mp = malloc( sizeof( int ) );
You don't check to see whether this fails to allocate the requested
memory...
done

> mp = &i;
...which doesn't really matter, since you throw it away here.

well, then how can I generate a new variable every-time I enter into the
loop ?
Well done. You just filled arr_p with a bunch of pointers to i. Why bother
with the malloc call, then? You could save yourself (ARRSIZE-1) *
sizeof(int) bytes of memory leak by removing the malloc call completely.
I can but I did not because I want to understand the how pointers to
arrays to pointers behave and learn them.
You don't even /try/ to iterate through the array, do you?
okay, here is a little fixed version. I can't do anything about variable i
in for loop as I said, I can't find a way to generate new variables at
every iteration through the loop.

You might want to take a long hard look at Visual Basic


http://lispmachine.wordpress.com/200...urn-for-vbnet/
or RCX.
never heard of it
--
http://lispmachine.wordpress.com/
my email ID is @ the above address

Jun 27 '08 #3

"arnuld" <No****@microsoft.comwrote in message
news:pa****************************@microsoft.com. ..
PURPOSE: see the comments.
WHAT I GOT: infinite loop
I've modified your code so that it behaves better:
#include <stdio.h>
#include <stdlib.h>

enum MAXSIZE { ARRSIZE = 100 };
int main( void )
{
int *arr_p[ARRSIZE];
int **pp;
int *np;
int i;

int null_int = 0;

pp = arr_p;
np = &null_int;
for( i = 0; i < ARRSIZE - 1; ++i )
{
arr_p[i] = malloc( sizeof( int ) );
*arr_p[i] = 1000+i; /* initial the ints to some recognisable
(and non-0!) value */
}
arr_p[i] = np; /* sentinel (*np contains 0) */

while( **pp) /* Step through array using pp */
{
printf("**pp = %d\n", **pp);
++pp;
}

return 0;
}

-- Bartc
Jun 27 '08 #4
[BTW, there seems to be somthing odd in the way you newsreader add
attribution lines. I've fixed it, I think.]

arnuld <No****@microsoft.comwrites:
On Fri, 02 May 2008 13:44:50 +0000, Richard Heathfield wrote:
>> for( i = 0; i < ARRSIZE - 1; ++i )
{
mp = malloc( sizeof( int ) );
>You don't check to see whether this fails to allocate the requested
memory...

done
>> mp = &i;
>...which doesn't really matter, since you throw it away here.

well, then how can I generate a new variable every-time I enter into the
loop ?
That is what malloc is for. C calls them objects, and you make them
exactly as you have written it. The error is overwriting the pointer
you get from malloc with one to i. Pointers to local variables like
i (automatic storage in C terms) are very rarely used.

--
Ben.
Jun 27 '08 #5
arnuld wrote:
PURPOSE: see the comments.
WHAT I GOT: infinite loop

/* This program will simply create an array of pointers to integers
* and will fill it with some values while using malloc to create
* pointers to fill the array and then will print the values pointed
* by those pointers
*
*/

#include <stdio.h>
#include <stdlib.h>

enum MAXSIZE { ARRSIZE = 100 };
int main( void )
{
int* arr_p[ARRSIZE];
int** pp;
int *mp, *np;
int i;

int null_int = 0;

pp = arr_p;
np = &null_int;
for( i = 0; i < ARRSIZE - 1; ++i )
{
mp = malloc( sizeof( int ) );
mp = &i;
arr_p[i] = mp;
}
arr_p[i] = np;

while( **pp )
{
printf("**pp = %d\n", **pp);
}

return 0;
}
/* BEGIN new.c */
/*
** This program will simply create an array of pointers to integers
** and will fill it with some values while using malloc to create
** pointers to fill the array and then will print the values pointed
** by those pointers
*/
#include <stdio.h>
#include <stdlib.h>

#define MAXSIZE 100

void free_ptrs(int **p, size_t n);

int main(void)
{
int i;
int *arr_p[MAXSIZE];
int **pp;

puts("/* BEGIN new.c output */\n");
for (i = 0; i < MAXSIZE - 1; ++i ) {
arr_p[i] = malloc(sizeof *arr_p[i]);
if (arr_p[i] == NULL) {
printf("arr_p[%d] == NULL\n", i);
break;
}
*arr_p[i] = i;
}
arr_p[i] = NULL;
for (pp = arr_p; *pp != NULL; ++pp) {
printf("**pp = %d\n", **pp);
}
free_ptrs(arr_p, i);
puts("\n/* END new.c output */");
return 0;
}

void free_ptrs(int **p, size_t n)
{
while (n-- != 0) {
free(*p);
*p++ = NULL;
}
}

/* END new.c */

--
pete
Jun 27 '08 #6

"santosh" <sa*********@gmail.comwrote in message
news:fv**********@registered.motzarella.org...
arnuld wrote:

Path: news.motzarella.org!motzarella.org!newsfeed.straub-nv.de!
goblin1!goblin2!goblin.stu.neva.ru!news.net.uni-c.dk!dotsrc.org!
filter.dotsrc.org!news.dotsrc.org!not-for-mail
From: arnuld <No****@microsoft.com>
You have no legal right to use that email address unless you are an
employee of Microsoft and have received their permission to do so.
Don't know the OP's newsreader but: if you open a news account with Outlook
Express, it does ask:

"Email address: ..... for example: so*****@microsoft.com"

Could someone really be sued for following this advice too literally?

-- Bartc

Jun 27 '08 #7
In article <fv**********@registered.motzarella.org>,
santosh <sa*********@gmail.comwrote:
>You have no legal right to use that email address unless you are an
employee of Microsoft and have received their permission to do so.
Do you have any basis for this claim? I don't recall any laws being
passed on the subject. Trademark law isn't relevant, since he's not
engaged in trade. He is clearly not using their name for any
fraudulent purpose. He's not misrepresenting himself (even if that
were illegal) since no-one would take it as a real email address.
RFCs have no legal force.

Nothing stops me from going around wearing a badge saying "Bill Gates,
Microsoft", unless I do it for some illegal purpose. Why should a
header in a news posting be any different?

At most he might be violating his ISP's terms and conditions.

-- Richard
--
:wq
Jun 27 '08 #8
Richard Tobin wrote:
In article <fv**********@registered.motzarella.org>,
santosh <sa*********@gmail.comwrote:
>>You have no legal right to use that email address unless you are an
employee of Microsoft and have received their permission to do so.

Do you have any basis for this claim? I don't recall any laws being
passed on the subject. Trademark law isn't relevant, since he's not
engaged in trade. He is clearly not using their name for any
fraudulent purpose. He's not misrepresenting himself (even if that
were illegal) since no-one would take it as a real email address.
RFCs have no legal force.

Nothing stops me from going around wearing a badge saying "Bill Gates,
Microsoft", unless I do it for some illegal purpose. Why should a
header in a news posting be any different?

At most he might be violating his ISP's terms and conditions.
I don't know about other countries, but I believe we have rules in our
so-called "Cyber Laws" that prohibit willfull impersonation and
misrepresentation. This would be particularly applicable if arnuld were
to comment upon Microsoft under this false email address. And why would
no one take it as a real email address? It's a perfectly valid domain
and hostname, though the latter may not exist. It's not a proper munged
address, nor an invalid address.

More practically Sunsite could terminate his account with them if they
were to be alerted to his behaviour. Their rules clearly say that users
are only to use their own email addresses which actually exist and can
be delivered to, in the Sender field.

Jun 27 '08 #9
santosh wrote, On 03/05/08 11:51:
Richard Tobin wrote:
>In article <fv**********@registered.motzarella.org>,
santosh <sa*********@gmail.comwrote:
>>You have no legal right to use that email address unless you are an
employee of Microsoft and have received their permission to do so.
Do you have any basis for this claim? I don't recall any laws being
passed on the subject. Trademark law isn't relevant, since he's not
<snip>
I don't know about other countries, but I believe we have rules in our
so-called "Cyber Laws" that prohibit willfull impersonation and
misrepresentation. This would be particularly applicable if arnuld were
to comment upon Microsoft under this false email address. And why would
no one take it as a real email address? It's a perfectly valid domain
and hostname, though the latter may not exist. It's not a proper munged
address, nor an invalid address.
Also some of us (well, me anyway) deliberately use addresses in our
domains that look like spamtraps. I've found that spam@ gets spammed
less than other addresses I've used.
More practically Sunsite could terminate his account with them if they
were to be alerted to his behaviour. Their rules clearly say that users
are only to use their own email addresses which actually exist and can
be delivered to, in the Sender field.
Ah well, I'm sure at some point someone will decide to report him to
them if he continues.
--
Flash Gordon
Jun 27 '08 #10
On Sat, 03 May 2008 16:21:35 +0530, santosh wrote:

More practically Sunsite could terminate his account with them if they
were to be alerted to his behaviour. Their rules clearly say that users
are only to use their own email addresses which actually exist and can
be delivered to, in the Sender field.

If I use my real email ID that means I am inviting 100% of spam. I don't
want to be spammed and no one wants to be spammed.

Regarding microsoft.com, I got that idea from my friend. He told me that
when he is using Outlook Express on WindowsXP, he gets this:
....@microsoft.com, as default address.

--
http://lispmachine.wordpress.com/
my email ID is @ the above address

Jun 27 '08 #11
On Sat, 03 May 2008 16:21:35 +0530, santosh wrote:

More practically Sunsite could terminate his account with them if they
were to be alerted to his behaviour. Their rules clearly say that users
are only to use their own email addresses which actually exist and can
be delivered to, in the Sender field.

I think this Server Policy is good:

http://news.aioe.org/spip.php?article3

--
http://lispmachine.wordpress.com/
my email ID is @ the above address

Jun 27 '08 #12
On Sat, 03 May 2008 16:21:35 +0530, santosh wrote:

More practically Sunsite could terminate his account with them if they
were to be alerted to his behaviour. Their rules clearly say that users
are only to use their own email addresses which actually exist and can
be delivered to, in the Sender field.

I have mailed them and have asked them to change their policy.

--
http://lispmachine.wordpress.com/
my email ID is @ the above address

Jun 27 '08 #13
arnuld said:
>On Sat, 03 May 2008 16:21:35 +0530, santosh wrote:

>More practically Sunsite could terminate his account with them if they
were to be alerted to his behaviour. Their rules clearly say that users
are only to use their own email addresses which actually exist and can
be delivered to, in the Sender field.


If I use my real email ID that means I am inviting 100% of spam. I don't
want to be spammed and no one wants to be spammed.
Nobody wants to be spammed. On the other hand, how would you like it if
someone used *your* real address in *their* From field?

All you have to do is invent an address that is in the correct form but
guaranteed not to exist. For example, sp**@spam.invalid is a well-formed
email address that definitely doesn't exist (because there is no top-level
domain called "invalid"). This is not an area where originality is
terribly important. If in doubt, use sp**@spam.invalid for From and
Reply-To, and mung your real email address in your sig block.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 27 '08 #14
On Mon, 05 May 2008 04:48:11 +0000, Richard Heathfield wrote:
Nobody wants to be spammed. On the other hand, how would you like it if
someone used *your* real address in *their* From field?
:(

All you have to do is invent an address that is in the correct form but
guaranteed not to exist. For example, sp**@spam.invalid is a well-formed
email address that definitely doesn't exist (because there is no top-level
domain called "invalid"). This is not an area where originality is
terribly important. If in doubt, use sp**@spam.invalid for From and
Reply-To, and mung your real email address in your sig block.

how about my present address ? It doe not use any real domain name and is
different enough from common words like spam, invalid, nospam etc.

BTW, I don't see Reply-To header for my own posts, not even for the posts
of BartC and santosh but I do see Reply-To header of yours. ( I have
already enabled all headers in PAN preferences)

--
http://lispmachine.wordpress.com/
my email ID is @ the above blog.
just check the "About Myself" page :)

Jun 27 '08 #15
arnuld wrote:
>Richard Heathfield wrote:
.... snip ...
>
>All you have to do is invent an address that is in the correct
form but guaranteed not to exist. For example, sp**@spam.invalid
is a well-formed email address that definitely doesn't exist
(because there is no top-level domain called "invalid"). This is
not an area where originality is terribly important. If in doubt,
use sp**@spam.invalid for From and Reply-To, and mung your real
email address in your sig block.

how about my present address ? It doe not use any real domain
name and is different enough from common words like spam, invalid,
nospam etc.
No. People can create new domains and addresses at any time. The
..invalid domain is guaranteed not to exist, and thus to never cause
problems.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #16
On Mon, 05 May 2008 02:25:53 -0400, CBFalconer wrote:
No. People can create new domains and addresses at any time. The
.invalid domain is guaranteed not to exist, and thus to never cause
problems.

so "invalid" is the only one that is usable :(

--
http://lispmachine.wordpress.com/
my email ID is @ the above blog.
just check the "About Myself" page :)

Jun 27 '08 #17
arnuld <su*****@domain.tldwrites:
>On Mon, 05 May 2008 02:25:53 -0400, CBFalconer wrote:
No. People can create new domains and addresses at any time. The
.invalid domain is guaranteed not to exist, and thus to never cause
problems.

so "invalid" is the only one that is usable :(
<OT>
No, it's not the only one, but it's the most appropriate for your
purposes. Point your web browser to <http://example.com/and follow
the link for more information.

But even if it were the only one, why would that be a problem? How
many invalid TLDs do you need? (Hint: the correct answer is an
integer between 0 and 2.)

If you want to discuss this further, please find a newsgroup or other
forum where it's topical.
</OT>

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #18
On 2 May, 14:44, Richard Heathfield <r...@see.sig.invalidwrote:
arnuld said:
PURPOSE: * * * * see the comments.
WHAT I GOT: * * *infinite loop
/* This program will simply create an array of pointers to integers
** and will fill it with some values while using malloc to create
** pointers to fill the array and then will print the values pointed
** by those pointers
**
**/
#include <stdio.h>
#include <stdlib.h>
enum MAXSIZE { ARRSIZE = 100 };
int main( void )
{
* int* arr_p[ARRSIZE];
* int** pp;
* int *mp, *np;
* int i;
* int null_int = 0;
* pp = arr_p;
* np = &null_int;
* for( i = 0; i < ARRSIZE - 1; ++i )
* * {
* * * mp = malloc( sizeof( int ) );

You don't check to see whether this fails to allocate the requested
memory...
* * * mp = &i;

...which doesn't really matter, since you throw it away here.
* * * arr_p[i] = mp;
* * }

Well done. You just filled arr_p with a bunch of pointers to i. Why
bother with the malloc call, then? You could save yourself
(ARRSIZE-1) * sizeof(int) bytes of memory leak by removing the malloc call completely.
* arr_p[i] = np;
* while( **pp )

pp has the value &arr_p[0], so **pp attempts to find the int value at
*arr_p[0]. Since arr_p[0] points to i, we're looking for the value of i.
That value is indeterminate, because the object i never had a value
assigned to it.
not even in the for loop?

Thus, the behaviour is undefined. This loop could execute
forever (the most likely possibility) or not at all (probably the
second most likely) or something completely weird could happen.
* * {
* * * printf("**pp = %d\n", **pp);
if you want to print a pointer (and **pp *isn't a pointer)
use %p. Instead of trying to be clever why not use a for loop?

for (i = 0; i < ARRSIZE; i++)
printf ("%p ", (void*)arr_p[i]);

printf ("\n");

* * }

You don't even /try/ to iterate through the array, do you? You might
want
to take a long hard look at Visual Basic or RCX.

--
Nick Keighley

My god it's full of stars!
Dave Bowman, on seeing HAL's source code
Jun 27 '08 #19
Nick Keighley said:
On 2 May, 14:44, Richard Heathfield <r...@see.sig.invalidwrote:
<snip>
>Since arr_p[0] points to i, we're looking for the value of >
i. That value is indeterminate, because the object i never had a value
assigned to it.

not even in the for loop?
Oops - good spot - apologies to OP.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 27 '08 #20
On 2 May, 15:05, arnuld <NoS...@microsoft.comwrote:
On Fri, 02 May 2008 13:44:50 +0000, Richard Heathfield wrote:
* for( i = 0; i < ARRSIZE - 1; ++i )
* * {
* * * mp = malloc( sizeof( int ) );
You don't check to see whether this fails to allocate the requested
memory...

done
* * * mp = &i;
...which doesn't really matter, since you throw it away here.

well, then how can I generate a new variable every-time I enter into
the loop ?
you can't. Well you can but you don't want to.

for( i = 0; i < ARRSIZE - 1; ++i )
{
int new;
arr_p[i] = &new;
}

The Standard doesn't say if new has the same address every time,
but on almost any reasonable implementation it does. Hence you
don't want to do this.

So why not malloc an object and store its address in the array?
You probably meant to do that but your code really didn't
do that.

for( i = 0; i < ARRSIZE - 1; ++i )
{
if ((mp = malloc (sizeof (int))) == NULL)
{
fprintf (stderr, "memory error\n");
abort();
}

arr_p[i] = mp;
}
<snip>

--
Nick Keighley

-pedantic
This option is not intended to be useful; it exists only to satisfy
pedants who would otherwise claim that GNU CC fails to support the
ANSI standard.
(Using and Porting GNU CC)
Jun 27 '08 #21
On 6 May, 14:44, Richard Heathfield <r...@see.sig.invalidwrote:
Nick Keighley said:
On 2 May, 14:44, Richard Heathfield <r...@see.sig.invalidwrote:

<snip>
Since arr_p[0] points to i, we're looking for the value of >
i. That value is indeterminate, because the object i never had a value
assigned to it.
not even in the for loop?

Oops - good spot - apologies to OP.
some languages make it UB to acces the for loop variable
outside the loop (I think- Pascal, Alogol-60 and Ada)
but I think it is guaranteed to point one past the end
of the array after exiting from a "normal" for-loop.
(I can't be arsed to define the exit value in Standarese).
--
Nick Keighley

Jun 27 '08 #22
Nick Keighley <ni******************@hotmail.comwrites:
[...]
some languages make it UB to acces the for loop variable
outside the loop (I think- Pascal, Alogol-60 and Ada)
but I think it is guaranteed to point one past the end
of the array after exiting from a "normal" for-loop.
(I can't be arsed to define the exit value in Standarese).
There's nothing magical about a C90-style for loop. A variable that
happens to be used in one or more of the for loop header's expressions
has whatever value it has after the loop terminates. This:

int i;
for (i = 0; i < 100; i ++) {
/* code that doesn't modify i */
}
printf("i = %d\n", i);

will print "i = 100".

C99 introduces the ability to define a variable in the loop header:

for (int i = 0; i < 100; i ++) { ... }

Referring to such a variable outside the loop isn't merely undefined
bhaevior, it's impossible. (Well, you could save its address in a
pointer variable; dereferencing the pointer outside the loop would
invoke undefined behavior.)

For comparison ...

<OT>
In Pascal, a for loop specifies a range. I *think* the value is
unspecified after the loop terminates, but I don't remember -- and it
probably varies among various implementations and pseudo-standards. I
don't know about Algol-60. Ada's for loop is much more restrictive
than C's:
for I in 0 .. 99 loop
...
end loop;
``I'' is treated as a constant (a non-modifiable object) within the
body of the loop, and doesn't exist outside the loop. You could take
its address and try to refer to it from outside the loop, as you can
in C, but Ada discourages that kind of thing; if you do it anyway, you
get Ada's equivalent of undefined behavior.
</OT>

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #23
Nick Keighley wrote:
>
.... snip ...
>
some languages make it UB to acces the for loop variable
outside the loop (I think- Pascal, Alogol-60 and Ada)
but I think it is guaranteed to point one past the end
of the array after exiting from a "normal" for-loop.
(I can't be arsed to define the exit value in Standarese).
If you define it within the for statement you get the Pascal
effect. E.g. try: "for (int i = 0; i < max; i++) ...;". i
disappears on exit.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #24
On Mon, 05 May 2008 02:25:53 -0400, CBFalconer <cb********@yahoo.com>
wrote:
arnuld wrote:
how about [ <su*****@domain.tld]? It doe not use any real domain
name and is different enough from common words like spam, invalid,
nospam etc.

No. People can create new domains and addresses at any time. The
.invalid domain is guaranteed not to exist, and thus to never cause
problems.
With profuse apologies to Kilmer, only ICANN can make a TLD.
And except for 2char ccTLDs which defer to ISO 3162 MA,
their process is quite public and slow enough you can get plenty of
warning of a possible conflict. But .invalid is indeed guaranteed.

- formerly david.thompson1 || achar(64) || worldnet.att.net
Jun 27 '08 #25

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

Similar topics

27
by: Abdullah Kauchali | last post by:
Hi folks, Can one rely on the order of keys inserted into an associative Javascript array? For example: var o = new Object(); o = "Adam"; o = "Eve";
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
46
by: TTroy | last post by:
Hi, I'm just wondering why people/books/experts say "the function returns a pointer to.." or "we have to send scanf a pointer to.." instead of "the function returns the address of.." or "we have...
2
by: Alfonso Morra | last post by:
Hi, I want to create a container structure (array/list etc), that is expandable. Currently, I have static arrays like this SomeStruct *ptrArray ; What I want to do is to be able to use...
14
by: Alf P. Steinbach | last post by:
Not yet perfect, but: http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01.pdf http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01_examples.zip To access the table of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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
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...

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.