Hi.
I'm new to C and I have a little problem.
I want to take an argv from the command line , (running Linux) and then take the argv and use it in an file movment.
The code looks like this
main (int argc, char *argv[])
file = (mv argv[1] -> newfile.txt)
The last line is the problem.
I don't know how to insert the argv[1]
Lets say I run the program
program 123.txt [enter]
the program vill now move file 123.txt to newfile.txt
Maybe someone know ?
Thanks
I'm new to C and I have a little problem.
I want to take an argv from the command line , (running Linux) and then take the argv and use it in an file movment.
The code looks like this
main (int argc, char *argv[])
file = (mv argv[1] -> newfile.txt)
The last line is the problem.
I don't know how to insert the argv[1]
Lets say I run the program
program 123.txt [enter]
the program vill now move file 123.txt to newfile.txt
Maybe someone know ?
Thanks