home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex048.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  741b  |  24 lines

  1.                                   // Example: 048 from Library Reference
  2. #include  "..\3D-Ware\dddware.h"
  3. #include  <stdio.h>
  4. #include  <string.h>
  5.  
  6. char   far *env_ptr, *tmp_ptr;
  7. short  len, count;
  8. char   far buffer[256];
  9.  
  10. void  main(void)
  11. {
  12.   env_ptr = dddGetEnvSeg();       // Get a far pointer to the Env. Vars.
  13.   tmp_ptr = env_ptr;
  14.  
  15.   do
  16.   {
  17.     len = strlen(tmp_ptr);        // Get the length of the ASCII string.
  18.     strncpy(buffer,tmp_ptr,len);  // Copy the string to a temp buffer.
  19.     printf("%s\n",tmp_ptr);       // Display the string.
  20.     tmp_ptr = tmp_ptr + len +1;   // Add the length of the string +1 to the pointer.
  21.   }
  22.   while (*tmp_ptr !=0);           // Do this until the env. vars. are finished.
  23. }
  24.