program crashing despite no errors and warnings
my main aim here, is to get the command line arguments, and ideally assign them to variables and them and do something.. trouble is, the program doesnt seem to work..and inspite of 0 errors and warnings when building, when i run the first program, it prints out the number of arguments, but then crashes.
Code:
#include <stdio.h>
void main (int argc, char *argv)
{
int n;
printf("\n No. of arguments:%d",argc);
printf("%s",argv[1]);
for(n=0;n<argc;n++)
{
printf("\n Argv(%d) is %s",n,argv[n]);
}
}
and this is the output from the problem details,
Problem signature:
Problem Event Name: APPCRASH
Application Name: user_interface.exe
Application Version: 0.0.0.0
Application Timestamp: 4c869bfd
Fault Module Name: msvcrt.dll
Fault Module Version: 7.0.7600.16385
Fault Module Timestamp: 4a5bda6f
Exception Code: c0000005
Exception Offset: 0000d193
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 3081
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
have i forgotten anything?