![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
problem accessing environment in GNU sys.
helloo...ill start off with this simple code:
#include <stdio.h>
#include <stdlib.h>
extern char **environ;
int main() {
char *pathval;
if((pathval = getenv("PATH")) != NULL)
puts(pathval);
putenv("Forum=Programming");
} |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Generally speaking, yup, it goes away. Each process gets it's own copy.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Programmer
|
thanx
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|