Re: how to test this piece of C code
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Sat, 10 Mar 2007 09:21:20 +0000
subramanian100in@xxxxxxxxx, India said:
On Mar 10, 3:27 am, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
subramanian10...@xxxxxxxxx, India said:
Thanks for the suggestion.
Kindly bear with me for the following question.
I am just learning C at present. So I may not need SIZE_MAX memory
for testing purpose now.
However, in real world applications ie in Job envorinment(I am
preparing for interview/skill test, etc), will they have more than
4GB of RAM in order to test such code ?
I doubt it very much. Most code shops have pretty run-of-the-mill
collections of PCs, with as little RAM as they think they can get
away with.
I do not understand this. Kindly explain. Does it mean that in real
world applications SIZE_MAX memory won't be asked from malloc/realloc
No, it doesn't mean that.
or there won't be 4GB of input file for testing ?
No, it doesn't mean that, either. It just means that most companies are
unlikely to have a machine containing that much physical RAM.
malloc/realloc have size_t as parameter type which is unsgined int.
So, doesn't it mean that there may be requirement for 4GB of dynamic
memory ?
size_t may or may not be an unsigned int, and size_t may or may not be
32 bits wide. In your case, it seems, it is - but how do you know how
wide size_t will be on your interviewer's system?
There are always limits to any human endeavour, and that certainly
includes computing. Dealing intelligently with limits is a large part
of the skill involved in programming.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.
- Follow-Ups:
- Re: how to test this piece of C code
- From: Randy Howard
- Re: how to test this piece of C code
- References:
- how to test this piece of C code
- From: subramanian100in@xxxxxxxxx, India
- Re: how to test this piece of C code
- From: Richard Heathfield
- Re: how to test this piece of C code
- From: subramanian100in@xxxxxxxxx, India
- Re: how to test this piece of C code
- From: Randy Howard
- Re: how to test this piece of C code
- From: subramanian100in@xxxxxxxxx, India
- how to test this piece of C code
- Prev by Date: Re: how to test this piece of C code
- Next by Date: Re: how to test this piece of C code
- Previous by thread: Re: how to test this piece of C code
- Next by thread: Re: how to test this piece of C code
- Index(es):
Relevant Pages
|