maximum size of a program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mohangupta13@gmail.com

    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
  • Obnoxious User

    #2
    Re: maximum size of a program

    On Fri, 21 Mar 2008 02:44:37 -0700, mohangupta13 wrote:
    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

    Comment

    • Andy Champ

      #3
      OT: Re: maximum size of a program

      mohangupta13@gm ail.com wrote:
      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

      Comment

      • Rolf Magnus

        #4
        Re: maximum size of a program

        mohangupta13@gm ail.com wrote:
        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.

        i mean i tried to declare an 10000 size long double array and the
        How exactly?
        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.
        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.

        Comment

        • =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=

          #5
          Re: maximum size of a program

          On 2008-03-21 10:44, mohangupta13@gm ail.com wrote:
          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.
          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

          Comment

          • James Kanze

            #6
            Re: maximum size of a program

            On 21 mar, 10:44, mohangupt...@gm ail.com wrote:
            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.
            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.
            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.kan ze@gmail.com
            Conseils en informatique orientée objet/
            Beratung in objektorientier ter Datenverarbeitu ng
            9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

            Comment

            Working...