Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need help about c++

  1. May 28, 2012 #1
    In a c language, what is the maximum combined length of command line arguments
    including the space between adjacent arguments.?
  2. jcsd
  3. May 28, 2012 #2


    User Avatar
    Gold Member
    2016 Award

    I don't think command line argument restrictions have anything to do with what code an app is written in, it's an O.S. characteristic and is likely to vary among Windows / MAC OS / UNIX.

    I think, years ago, there was a DOS and early-windows restriction of 256 characters but I don't know that that still holds in windows.
  4. May 28, 2012 #3
    i cannot understand
  5. May 28, 2012 #4


    User Avatar
    Science Advisor
    Homework Helper

    The limit depends on the operating system and the command shell you are using, not on the C language.

    On Windows XP, Vista, and Windows 7 it is 8191 characters.
    On some Unix systems it is much bigger, with limits like 65536 or even 262144 characters.

    Look for the constant ARG_MAX in your C ibrary header files.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Need help about c++
  1. Need C++ getline() Help (Replies: 17)