How to judge whether a path is relative or absolute?

This is a discussion on How to judge whether a path is relative or absolute? within the C Programming forums, part of the General Programming Boards category; As the title, is there a function in GNU C library?...

  1. #1
    Why bbebfe is not bbebfe? bbebfe's Avatar
    Join Date
    Nov 2008
    Location
    Earth
    Posts
    27

    Question How to judge whether a path is relative or absolute?

    As the title, is there a function in GNU C library?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    It begins with a dot.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,743
    I am not entirely sure, but I believe that a simple check for a leading '/' or a drive label like 'C:' would suffice, depending on platform, of course.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to get relative mouse coordinates when GLUT return absolute
    By joeprogrammer in forum Game Programming
    Replies: 14
    Last Post: 02-10-2009, 05:35 PM
  2. MSVC: output .pd under relative path?
    By pheres in forum Windows Programming
    Replies: 0
    Last Post: 02-04-2008, 09:55 AM
  3. Path of file relative to program
    By ulillillia in forum C Programming
    Replies: 13
    Last Post: 04-15-2007, 05:30 AM
  4. how to obtain the absolute application path
    By jagerhans in forum Linux Programming
    Replies: 4
    Last Post: 12-23-2004, 04:48 PM
  5. linked list recursive function spaghetti
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2003, 02:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21