Thread: getenv

  1. #1
    Unregistered
    Guest

    Question getenv

    #include <iostream.h>
    #include <stdlib.h>

    int main()
    {

    cout<<getenv("PATH");
    return 0;
    }//end main


    I need to parse the string and print each directory on one line. Can someone point me in the right direction. Thanks in advance

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    just parse the string for the '\\' that seperates the directories and then split each one accordingly.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getenv() causes segfault in recv() loop
    By MK27 in forum Networking/Device Communication
    Replies: 3
    Last Post: 12-05-2008, 02:04 PM
  2. sprintf getenv buffer overflow
    By bue in forum Linux Programming
    Replies: 7
    Last Post: 08-15-2005, 08:17 AM
  3. question about getenv...etc???
    By smd in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2003, 05:32 AM
  4. QUERY_STRING in CGI with a C/C++ Program
    By stovellpaul in forum C++ Programming
    Replies: 5
    Last Post: 10-03-2002, 01:51 AM
  5. getenv function
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 04-15-2002, 10:51 AM
Website Security Test