Monday, May 09, 2011

Re: [Cpp-Programming] file copy program with arguments taken in main function

Mr. Alam,

Thanks a lot for helping me!

gcc -o filecopy your_cpp_file_name

./filecopy file1.txt file2.txt


Actually I even didn't get any errors in the code but I didn't know how to execute it.
As I am new to Linux environment, I did not know how to deal with it.
This is what I have done at terminal.

gcc filename_source.c
<then I again used >
./a.out < which I usually do for getting output.

But Mr. Alam can you explain me why you have written the code that you mentioned instead of using the one I mentioned above. I have seen that there is a file created 'filecopy' in the default location just like 'a.out'.
And also please tell me how do I deal with files which are not present in default locations.

Thanks!

--
You received this message because you are subscribed to the Google Groups "C++ Programming" group.
To post to this group, send email to cpp-programming@googlegroups.com.
To unsubscribe from this group, send email to cpp-programming+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cpp-programming?hl=en.

0 Comments:

Post a Comment

<< Home