Thursday, 29 November 2012

Week13_Display the environment variable path

#include <iostream>
using namespace std;

int main(int argc, char* argv[], char* env[]) {
    int len = strlen(env[0]);
    int pos = 0;
    int i=0;
    while(env[0][i] != '='){
        i++;
    }
    for(pos = i+1;pos<len;pos++){
        cout <<env[0][pos];
    }
    cout<<endl;
    return 0;
}

No comments:

Post a Comment