Re: entering more characters



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

kk wrote:
> Hi all,
>
> in the following code, i enter more characters into a character array.
> array size declared as 80. i enter more characters then i get
> segmentation fault. if anybody knows give me reply.
> thanks in advance.

A truism that my mother taught me applies here...

"You cant stuff a size 10 foot into size 7 shoes. Either the shoes split
or your foot does."

In this case, you can't stuff more than 80 chars into an 80 char array.
If you do, you write over something (what, we cannot tell you) outside
of the array, and cause your program to fall over.

In other words (to quote Mel Brooks) "Don't do that."


- --

Lew Pitcher, IT Specialist, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFC54OMagVFX4UWr64RAjdCAKDU7DZ4Ot0WxHF5vRZRCP2iG8VqBACfd7HD
nRoS+pj0njgGDI/r4rgynpU=
=xJza
-----END PGP SIGNATURE-----
.



Relevant Pages

  • Re: sending echo to all clients
    ... I did initialize it up properly, ... There is only one array and that is an array of pollfd structures named ... as an array of characters only but then I can't because sendsends bytes ... you receive C-style strings, so there's really no point to doing it. ...
    (comp.unix.programmer)
  • Re: Subquery Confusion
    ... Then I got this crazy idea that an Array can only contain a maximum ... number of characters, ... Then I decide that maybe I'm completely wrong with my query, ... it out of Excel VBA and spit it into Microsoft SQL Server Management ...
    (microsoft.public.excel.programming)
  • Re: ifstream::get() surprise
    ... Extracts characters and stores them into successive locations ... > null character into the next successive location of the array. ... since the rule is to post the shortest code suffering from the ...
    (comp.lang.cpp)
  • Re: Problem with inserting bytea into postgresql
    ... > This byte array is serialized object. ... > ByteArrayOutputStream outputStream = new ByteArrayOutputStream; ... and the characters are encoded via UTF-8. ...
    (comp.lang.java.help)
  • Re: Parsing binary values in the registry
    ... how to take a string variable that could concievably be up to 300 ... and split that into either an array or multiple variables for ... every 32 characters within the original varable. ... I am trying to build a file path from a binary value in the ...
    (microsoft.public.scripting.vbscript)