R
Roman Mashak
Hello,
can't realize what's happening in this code snippet:
int main(int argc, char *argv[])
{
char buf[256];
strcpy(buf, argv[1]);
...
}
Debugger shows argv[1] as NULL and as a result I get 'segmentation fault' on
'strcpy' call. I can't figure out why NULL is not a proper in this case,
standard doesn't prohibit it in string functions (at least I have not found
it).
With best regards, Roman Mashak. E-mail: (e-mail address removed)
can't realize what's happening in this code snippet:
int main(int argc, char *argv[])
{
char buf[256];
strcpy(buf, argv[1]);
...
}
Debugger shows argv[1] as NULL and as a result I get 'segmentation fault' on
'strcpy' call. I can't figure out why NULL is not a proper in this case,
standard doesn't prohibit it in string functions (at least I have not found
it).
With best regards, Roman Mashak. E-mail: (e-mail address removed)