Array size limits

D

Dan Pop

In said:
I don't know how ANSI C says. But the stacksize of a program in runtime is
limited by Opterating System. So that C compiler always doesn't give out an
compile time error.

If you are on Linux, you can use "limit" command to show the limits and use
"limit stacksize 1000000" to change them. I think your program will work OK
after change the limit.

How do you know the OP's array was automatically allocated?

Dan
Carol Depore said:
How do I determine the maximum array size?

For example, int a[10000] works, but a[10000000] does not (run time
error).
 
G

grv575

Please use google groups to read news. It syntax highlights
everything so threads aren't difficult to follow either way. Btw, I
prefer "topposting" since you don't have to scroll past what's already
been said in the thread.

I'm really surprised though that noone has pointed out so far that
most compilers will have some kind of flag or directive to allow a
larger stack size which is the most likely wall you're running in to
(all this talk of standards and no real solutions).

Keith Thompson said:
Wei Li said:
I don't know how ANSI C says. But the stacksize of a program in runtime is
limited by Opterating System. So that C compiler always doesn't give out an
compile time error.

If you are on Linux, you can use "limit" command to show the limits and use
"limit stacksize 1000000" to change them. I think your program will work OK

Carol Depore said:
How do I determine the maximum array size?

For example, int a[10000] works, but a[10000000] does not (run time
error).

Thank you.

Wei Li: Please don't top-post.

Top-posting means writing your new material first, followed by the
quoted article to which you're responding. It makes it difficult to
follow the discussion, especially when (almost) everyone else
bottom-posts, as I'm doing there. (You should also trim anything
that's not relevant to your response, though in this case the previous
article was short enough that quoting the whole thing is probably ok.)

Thanks.
 
F

Flash Gordon

On 1 Sep 2004 07:59:26 -0700
Please use google groups to read news.

Google is an on-line service that performs badly as a news reader. Many
people read groups off-line for a number of good reasons, including
dial-up connections where you pay per minute for being connected.
It syntax highlights
everything so threads aren't difficult to follow either way.

Yes they are. My news reader colour-codes quoted text, but to understand
you post I had to scroll to the bottom to see what you were replying to
then scroll back up to see your response. Posting after the quoted
material means that anyone with a decent news reader (and a lot of
people with horrible things which just about allow one to read news) can
run through a group by just hitting the space bar, only having to do
something else when replying.
Btw, I
prefer "topposting" since you don't have to scroll past what's already
been said in the thread.

That is why one snips material that is not relevant to the reply,
summarising if appropriate.
I'm really surprised though that noone has pointed out so far that
most compilers will have some kind of flag or directive to allow a
larger stack size which is the most likely wall you're running in to
(all this talk of standards and no real solutions).

The most likely solution is using malloc and this has been suggested.

<snip>
 
D

Default User

grv575 said:
Please use google groups to read news.

The absolute worst newsreader/news provider? Why?
Btw, I
prefer "topposting" since you don't have to scroll past what's already
been said in the thread.

If you want to participate in this newsgroup, you'll be advised to
follow the posting conventions. Many, like me, will killfile you if you
don't stop top-posting.

Search the web for the many, many arguments against top-posting.



Brian Rodenborn
 
K

Keith Thompson

Please use google groups to read news. It syntax highlights
everything so threads aren't difficult to follow either way. Btw, I
prefer "topposting" since you don't have to scroll past what's already
been said in the thread.

The nearly universal convention of this newsgroup is to avoid
top-posting. There are good reasons for this, which you can see in
other responses to your article. The best reason, though, is that
it's the convention; if you top-post while everyone else bottom-posts,
your articles are going to be harder to read that everyone else's.

Even if you assume that bottom-posting is better than top-posting, a
mixture of the two is going to be worse than either one used
consistently.

And, of course, the concern about scrolling past what's already been
said is addressed by trimming anything that's not relevant to your
response. If you expect your readers to scroll past it, why post it
in the first place?
 
C

CBFalconer

*** Evil top-posting fixed ***
... snip ...


Please use google groups to read news. It syntax highlights
everything so threads aren't difficult to follow either way. Btw,
I prefer "topposting" since you don't have to scroll past what's
already been said in the thread.

In comp.lang.c you are requested to bottom post (or interleave)
with proper snipping of irrelevant material. If you don't you may
well be plonked, which means that many people will never see any
of your posts. This tends to be non-productive.

Google groups is one of the slowest and awkwardest ways to read
news. Among other things many items never appear there, due to
foolish use of X-noarchive, and things that do appear have a delay
of several hours. On the other hand its archive is invaluable,
and it provides access for people without a newsreader (or behind
firewalls that prevent newserver access). This generally includes
library access, for example.
I'm really surprised though that noone has pointed out so far that
most compilers will have some kind of flag or directive to allow a
larger stack size which is the most likely wall you're running in to
(all this talk of standards and no real solutions).

Such compiler or system specific things are not portable, and are
thus off-topic here. Thus the proper reference is to a group
dealing with the specific system. There is not necessarily any
such thing as a stack.
 
M

Martin Ambuhl

grv575 top-posted:
Please use google groups to read news.
[etc.]

Didn't you see the requests to Wei Li that he not top-post? Why do you
think you merit an exemption?
 
G

grv575

Flash Gordon said:
On 1 Sep 2004 07:59:26 -0700


Google is an on-line service that performs badly as a news reader. Many
people read groups off-line for a number of good reasons, including
dial-up connections where you pay per minute for being connected.

I've also used xnews quite a bit which also makes it irrelevant
whether the replies are top or bottom-posted. Top-posted text will be
visible first and it automatically skips quoted text (as an option).

The google comment could be change to 'use a decent threaded
newsreader' and it still wouldn't matter how someone chooses to reply
(assuming you thread the articles and read them as a group if you want
to get proper context).
 
G

grv575

Martin Ambuhl said:
grv575 top-posted:
Please use google groups to read news.
[etc.]

Didn't you see the requests to Wei Li that he not top-post? Why do you
think you merit an exemption?

Thanks for the dictatorial reply. If it's in the comp.lang.c faq then
that's fine, but what gives you or the previous poster any moderator
privledges?
 
G

grv575

CBFalconer said:
Google groups is one of the slowest and awkwardest ways to read
news. Among other things many items never appear there, due to
foolish use of X-noarchive, and things that do appear have a delay
of several hours. On the other hand its archive is invaluable,
and it provides access for people without a newsreader (or behind
firewalls that prevent newserver access). This generally includes
library access, for example.

I don't see why everyone hates google groups so much (aside from the
X-noarchive header buisness) as a newsreader. It's accessible
anywhere, and instead of using the spacebar to read all the messages,
using the scroll button on the mouse works just as nicely.
 
G

grv575

Flash Gordon said:
The most likely solution is using malloc and this has been suggested.

Or increasing the stacksize.
Or using non-local storage (a global variable for example).
 
F

Flash Gordon

On 3 Sep 2004 06:04:57 -0700
Martin Ambuhl said:
grv575 top-posted:
Please use google groups to read news.
[etc.]

Didn't you see the requests to Wei Li that he not top-post? Why do
you think you merit an exemption?

Thanks for the dictatorial reply. If it's in the comp.lang.c faq then
that's fine, but what gives you or the previous poster any moderator
privledges?

Since you are a fan of Google Groups, here is a quote from their posting
FAQ (http://groups.google.com/googlegroups/posting_style.html) :

| Summarize what you are following up.
|
| When you follow up an existing article, Google Groups includes the
| full article in quotes, with the cursor at the top of the article.
| Tempting though it is to just start typing your message, please STOP
| and do two things first. Look at the quoted text and delete parts that
| are irrelevant. Then, go to the BOTTOM of the article and start typing
| there. Doing this makes it much easier for your readers to get through
| your post. They'll have a reminder of the relevant text before your
| comment, but won't have to re-read the entire article. And if your
| reply appears on a site before the original article does, they'll get
| the gist of what you're talking about.

The emphasis (putting STOP and BOTTOM in upper case) is Googles, not
mine.

This is just Googles interpretations of the normal Usenet conventions.
There is also an RFC that covers it, but the RFC is not as easy to read
as the above.
 
F

Flash Gordon

On 3 Sep 2004 06:00:41 -0700
I've also used xnews quite a bit which also makes it irrelevant
whether the replies are top or bottom-posted. Top-posted text will be
visible first and it automatically skips quoted text (as an option).

One that would be a real pain for me if it was enabled, since on
returning to a thread I always have to scan the text that is being
replied to in order to get context before reading the first reply.
The google comment could be change to 'use a decent threaded
newsreader' and it still wouldn't matter how someone chooses to reply
(assuming you thread the articles and read them as a group if you want
to get proper context).

You get absolutely no context from a post that has not yet reached your
server, therefor you have to post on the assumption that some of the
audience will not see the article you are responding to prior to seeing
your reply. In this case the comment I made else where about having to
scroll up and down being a pain still applies. If someone does what you
suggest then it is even worse if they have not just read the previous
message since they have to unhide the quoted text, scroll down whilst
reading then scroll back up to start again. However, many excellent
threaded news readers do not hide quoted text for the very good reason
that if posts are done properly there is no need to hide quoted text.
 
F

Flash Gordon

On 3 Sep 2004 06:24:15 -0700
Or increasing the stacksize.
Or using non-local storage (a global variable for example).

I said the most likely solution, not the only possible solution.

I know of real systems still in use today where you have a fixed
global+static data limit of 64K but you can get as much memory as is
available on the machine using malloc without changing any options. I
did not have a C implementation on the system in question, but since it
was a limit in the OS it is unlikely that any C compiler would have side
stepped it.

Using malloc also means you can trap the error if you don't have enough
memory and either handle the situation (possibly by using temporary
files) or give the user a nice friendly report on the problem.
 
K

Keith Thompson

I don't see why everyone hates google groups so much (aside from the
X-noarchive header buisness) as a newsreader. It's accessible
anywhere, and instead of using the spacebar to read all the messages,
using the scroll button on the mouse works just as nicely.

If it works for you, that's great; we have no objection to your using
it. But whichever newsreader you use, you need to remember that not
everyone is going to use the same one. The conventions we use here
have evolved over many years as the best way to make sure everyone's
articles are as legible as possible.
 
C

CBFalconer

grv575 said:
I don't see why everyone hates google groups so much (aside from
the X-noarchive header buisness) as a newsreader. It's accessible
anywhere, and instead of using the spacebar to read all the
messages, using the scroll button on the mouse works just as nicely.

It is not a matter of hate, it is a matter of slowness and
functions. Google fouls threading. To use it you have to have
various things enabled in the browser, which increases the
possibility of intrusion. You can't use it in an off-line mode.
The same thing applies to any web-based newsreader. I use my ISPs
web based access purely to examine the list and weed out the spam
on my email (unless I am away from home). I can format my replies
as I wish, conveniently grab and paste anything, etc. when using a
proper newsreader.
 
D

Default User

grv575 said:
I don't see why everyone hates google groups so much (aside from the
X-noarchive header buisness) as a newsreader. It's accessible
anywhere, and instead of using the spacebar to read all the messages,
using the scroll button on the mouse works just as nicely.

<meta-topical?>

These comments are about the primary service, I haven't tried Beta.

1. There's no way to mark messages as read.

2. It takes hours to have posts show up even on their system, let alone
the rest of the world.

3. It conflates dissimilar threads that happen to have the same subject.

4. Changing the subject starts a new thread.

5. No killfile or filtering ability.


The bottom line is, groups.google is a pretty good archive and handy to
have. As a newsreading system, it sucks. There's no good reason to use
it except in the most dire circumstances. The free news server at
http://news.individual.net is a far better product. Decent free
newsreaders are available by the dozen.

</meta-topical?>



Brian Rodenborn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top