classics Re: More than 2, but less than 3 GiB per process memory?
On Mon, 26 Sep 2005, Hendrik Boom wrote:
> > Here is the very simple test program.
> > 
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <malloc.h>
> > 
> > const int amountK = 1024;
> > 
> > int main()
> > {
> >   unsigned long count = 0;
> > 
> >   for (;;)                      /* loop forever */
> >     {
> >       char *p = malloc(amountK*1024);
> >       printf("%08lu 0x%lx\n",count++,(unsigned long)p);
> > 
> >       if (p == 0)
> >         {
> >           printf("Out of memory at %ld M\n",count / (1024 / amountK));
> >           exit(0);
> >         }
> >     }
> >   return 0;
> > }
ain't that a classic .. all software and hardware an middleware
folks should be able to write and rewite that in gazillion languages
( each language that shows up on your resume )
:-)
-- other classic apps ..
	- read track0, head 0, sector 0  ( aka the MBR )
	- list of hardware ( precursors of lspci didn't exist )
	- show date/calendar for any year ( not too trivial as it sounds 
	due to "leap centuries" and other whackyness )
	- tower of hanoi
	- tcp/ip test ... ping.c
- that's the first 10minuts of your interview :-)
  ( sanity checking the alphabet soup on the resume/CV )
c ya
alvin
Reply to: