SHARE
TWEET

Untitled

a guest Oct 3rd, 2010 220 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.         char*addr;
  7.         if(argc < 2)
  8.         {
  9.                 printf("Uso:\n%s <variable de entorno>\n", argv[0]);
  10.                 exit(0);
  11.         }
  12.  
  13.         addr = getenv(argv[1]);
  14.  
  15.         if(addr == NULL)
  16.                 printf("La variable de entorno %s no existe.\n", argv[1]);
  17.         else
  18.         printf("%s está localizada en %p\n", argv[1], addr);
  19.  
  20. return 0;
  21. }
RAW Paste Data
Top