putenv.cc
来自「达内IT培训Unix C++第一天源码 是入门Unix 下C++编程的好东西」· CC 代码 · 共 18 行
CC
18 行
#include <iostream>using namespace std;#include <stdlib.h>#include <string>int main(){ string str; str = "CPP=tarena"; int r = putenv((char*)str.c_str()); if(r<0) cout << "error!" << endl; else cout << "success!" << endl; char* p = getenv("CPP"); if(p==NULL) cout << "no CPP!" << endl; else cout << p << endl;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?