# Environmental Variables in to Array List

Page 1 of 1

## 1 Replies - 430 Views - Last Post: 10 January 2013 - 01:46 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=306564&amp;s=b0fa31dc3504a3544b25f19106f3c72a&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 grimscorpios

• New D.I.C Head

Reputation: 0
• Posts: 1
• Joined: 10-January 13

# Environmental Variables in to Array List

Posted 10 January 2013 - 11:52 AM

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?

This post has been edited by Skydiver: 10 January 2013 - 06:09 PM
Reason for edit:: Put code in code tags. Please do it yourself in the future.

Is This A Good Question/Topic? 0

## Replies To: Environmental Variables in to Array List

### #2 Skydiver

• Code herder

Reputation: 4265
• Posts: 13,661
• Joined: 05-May 12

## Re: Environmental Variables in to Array List

Posted 10 January 2013 - 01:46 PM

Perhaps just adding line break between each loop iteration would help. (e.g. cout << endl; )