Moin! Ich hab da mal ne Frage zu putenv. Kann ich das innerhalb einer Funktion so aufrufen?
1 | void init() |
2 | {
|
3 | string blafalse = "Variable=Wert"; |
4 | putenv(blafasel); |
5 | }
|
In dem Beispiel wird der String ja nach Ende der Funktion gelöscht. Mir hat nun jemand (der eigentlich wirlich Ahnung von C++ hat) erzählt, dass der übergebene String erhalten bleiben muss. Davon hab ich allerdings noch nie was gehört, und auch beim googlen keinen Hinweis darauf gefunden, dass das so sein müsste.