
January 10th, 2013, 02:08 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 25
Time spent in forums: 8 h 53 m 34 sec
Reputation Power: 0
|
|
|
Need help for a problem
I am trying to get the IP address from the getenv but I am geting the out put as null for the REMOTE_ADDR and for HTTP_COOKIE. Bellow is my code..
Code:
#include <stdio.h>
#include<conio.h>
#include <windows.h>
#include <stdlib.h>
int main()
{
char *lp_ip ;
char *lp_cookie;
char *path;
char *lib;
lp_ip = getenv ("REMOTE_ADDR");
lp_cookie = getenv ("HTTP_COOKIE");
path = getenv ("PATH");
lib = getenv ("LIB");
printf("%s\n",lp_ip);
printf("%s\n",lp_cookie);
printf("%s\n",path);
printf("%s\n",lib);
return 0;
}
|