K
Kaye Ng
For example there's a code
lines = File.readlines(ARGV[0])
Why do i need the [0]?
I have another program, testingargv.rb with this code
puts ARGV.join('-')
(no [0] parameter)
if i type in the command prompt, testingargv.rb test 123
the result is test-123
i don't understand the logic behind [0] in
lines = File.readlines(ARGV[0])
thanks guys!
lines = File.readlines(ARGV[0])
Why do i need the [0]?
I have another program, testingargv.rb with this code
puts ARGV.join('-')
(no [0] parameter)
if i type in the command prompt, testingargv.rb test 123
the result is test-123
i don't understand the logic behind [0] in
lines = File.readlines(ARGV[0])
thanks guys!