Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 21st, 2008, 10:45 AM
mohangupta13@gmail.com
Guest
 
Posts: n/a
Default maximum size of a program

hello everyone can anyone please tell me is there any limit on the
size of the program you are creating.
i mean i tried to declare an 10000 size long double array and the
compilation error says segmentation fault.
please help me .and also is there anyway to find the digital signature
of an image using c++ or some c++ library.

thank you
mohan gupta
  #2  
Old March 21st, 2008, 11:05 AM
Obnoxious User
Guest
 
Posts: n/a
Default Re: maximum size of a program

On Fri, 21 Mar 2008 02:44:37 -0700, mohangupta13 wrote:
Quote:
hello everyone can anyone please tell me is there any limit on the size
of the program you are creating. i mean i tried to declare an 10000 size
long double array and the compilation error says segmentation fault.
please help me .and also is there anyway to find the digital signature
of an image using c++ or some c++ library.
>
You mean like

long double array[10000];

I think you're doing something more to earn the
segmentation fault.

--
OU
  #3  
Old March 21st, 2008, 11:25 AM
Andy Champ
Guest
 
Posts: n/a
Default OT: Re: maximum size of a program

mohangupta13@gmail.com wrote:
Quote:
hello everyone can anyone please tell me is there any limit on the
size of the program you are creating.
i mean i tried to declare an 10000 size long double array and the
compilation error says segmentation fault.
please help me .and also is there anyway to find the digital signature
of an image using c++ or some c++ library.
>
thank you
mohan gupta
This isn't an inherent C++ problem, but a system dependent one.

A double is going to be at least 4 bytes, and may be up to 10. If
you're on a 16 bit architecture (64Kb memory size) that won't fit. On
any 32 bit one I know about, it won't be a problem.

Strictly speaking, this is OT, and you should go to a group which is
specific to your system but if you post back details of the system and
the code that produces the problem you'll probably get help.

Andy
  #4  
Old March 21st, 2008, 11:45 AM
Rolf Magnus
Guest
 
Posts: n/a
Default Re: maximum size of a program

mohangupta13@gmail.com wrote:
Quote:
hello everyone can anyone please tell me is there any limit on the
size of the program you are creating.
Yes, but that is very system and compiler dependant.

Quote:
i mean i tried to declare an 10000 size long double array and the
How exactly?
Quote:
compilation error says segmentation fault.
Are you sure that you got the segfalut during _compiling_? If that's the
case, it's a compiler bug, since the compiler itself shouldn't crash.
Quote:
please help me .and also is there anyway to find the digital signature
of an image using c++ or some c++ library.
I don't known what you mean by "digital signature of an image", but I'd say
the C++ standard library doesn't offer it.

  #5  
Old March 21st, 2008, 01:05 PM
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a
Default Re: maximum size of a program

On 2008-03-21 10:44, mohangupta13@gmail.com wrote:
Quote:
hello everyone can anyone please tell me is there any limit on the
size of the program you are creating.
There isn't really a limit on the size but on a modern 32-bit
architecture you only have 2-3 GB virtual memory to play with. An array
of 10000 doubles doesn't even take 1 MB so that should not be a problem.
Quote:
i mean i tried to declare an 10000 size long double array and the
compilation error says segmentation fault.
If that is the compilation error that would mean that the compiler
crashed, are you sure it is not a run-time error? The most likely cause
of a segfault is that while accessing the array you are accessing an
element outside of the array. Please also note that it might be better
to use std::vector instead of using a raw array.

--
Erik Wikström
  #6  
Old March 22nd, 2008, 11:45 AM
James Kanze
Guest
 
Posts: n/a
Default Re: maximum size of a program

On 21 mar, 10:44, mohangupt...@gmail.com wrote:
Quote:
hello everyone can anyone please tell me is there any limit on the
size of the program you are creating.
It's unspecified, but unless you're compiling on a system with
infinite memory, there's bound to be some limit.
Quote:
i mean i tried to declare an 10000 size long double array and
the compilation error says segmentation fault.
The compiler segfaulted with something that small. Sounds like
a pretty poor implementation to me.

I have some machine generated C++ of a couple of million lines,
and the compiler (g++) outputs an error message to the effect
that it is out of memory.
Quote:
please help me .and also is there anyway to find the digital
signature of an image using c++ or some c++ library.
I'm not sure if it's what you mean, but there are several
libraries solutions for calculating different types of digital
signatures. (My own supports MD 5 and all of the SHA
signatures.)

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles