LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   [c] unix systems programming in MS VS C++? (https://www.linuxquestions.org/questions/programming-9/%5Bc%5D-unix-systems-programming-in-ms-vs-c-239606/)

saiz66 10-06-2004 08:06 PM

[c] unix systems programming in MS VS C++?
 
Hi. I am doing unix systems programming and was wondering if it is possible to do it in Microsoft Visual C++. Everything should work.. except there is one problem.. reading in arguments... here is an easy program:

#include <stdio.h>

int main ( int argc, char ** argv )
{
int i;

printf ( "The number of arguments (argc) is %d.\n", argc );
printf ( "The contents of the argument vector (argv) is:\n" );

for ( i = 0; i < argc; i++ )
printf( "argv[ %d ] = %s\n", i, argv[ i ] );

return 0;
}

this just prints out all the arguments... in unix it runs perfect since it has a command line.. but how could i enter the arguments in vs c++?? I just like the vs c++ error detection better.. its easier for me to read and understand. Thanks!

m00t00 10-06-2004 09:09 PM

use a dos shell, and run it like you would a unix program

deiussum 10-07-2004 08:16 AM

The VC++ IDE has a place where you can put the command line arguments when you run it right from the IDE as well. The exact location of that depends on what version you are using, but it should be somewhere in the debugging options.


All times are GMT -5. The time now is 05:57 AM.