Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Environmental Variables in to Array List

$
0
0
Problem: Cannot put environmental variables into a neat list on output:
Tried solutions: Thought an array list might work, however i am struggling to understand how i would go about it.

The working Code:

#include <iostream>
int main(int,char **,char ** envp) {
for(int i=0;envp[i]!=NULL;i++)
  std::cout << envp[i];
 system ("pause"); return 0;
}



This displays the environmental variables. How would i list them neatly.
An array? or another way?
Please help.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>