I'm trying to pass arguments to my program so that I can store them into an array. For some reason my IDE/compiler is treating the blank space in between arguments as an argument.
There is nothing wrong with your compiler or IDE -- that is the customary way C program startup code uses to parse and build argv strings. If you have a parameter that y0u want to include spaces, then you have to surround it with double quotes
c:> myprogram "This is one parameter" <Enter>
in the above, argc will be 2, argv[0] == the name of the program and argv[1] == "This is one parameter". Without the quotes, argc == 5 and there will be 6 strings in argv.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Online 21,961 posts
since Aug 2005