home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sftick.zip
/
beg
/
mem
/
mem.C
< prev
next >
Wrap
Text File
|
1994-04-09
|
722b
|
34 lines
#define INCL_DOSMEMMGR
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
int main ( VOID )
{
PBYTE pbBuffer = 0;
APIRET arReturn ;
USHORT usIndex ;
/* allocate some memory */
arReturn = DosAllocMem (( PPVOID ) &pbBuffer,
10,
PAG_READ | PAG_WRITE ) ;
/* if OK */
if ( arReturn == 0 ) {
/* loop 0-10, writing to the allocated memory */
for ( usIndex = 0 ; usIndex < 10 ; usIndex++ ) {
if (pbBuffer[usIndex])
pbBuffer [usIndex] = 1 ;
printf("\nusIndex = %d",usIndex ) ;
} /* endfor */
} /* endif */
return 0 ;
}