You can't copy a string without asigning space to it. So either you: char *inpname = argv[1]; printf(inpname); or printf(argv[1]); Otherwise you'll get a coredump. If you really want a copy of the string: char *inpname = new char[strlen(argv[1])+1]; strcpy(inpname,argv[1]); printf(inpname); but as you're in C++, you can use STL strings: #include<string> ... std::string inpname(argv[1]); printf(inpname.c_str()); Note that you should use printf("%s", inpname), or std::cout << inpname. Mickael Drean wrote: Hi there, |