I am using a simple main like this
#include <string.h>
int main(int argc, char **argv)
{
char buf[256];
strcpy(buf, argv[1]);
}
I understand that if compiled, this main will produce 'argc' with a value of one, and argv[1] would not exist as defined in this program. However, the memory address represented by argv[1], although not defined in this program, would not be modified by the program, as argv[1] is passed as a const char *. So my question is why strcpy cannot grab this char and write it into buf? Also, why is argc = 1?