A Place for Latest Exam wise Questions, Videos, Previous Year Papers, Study Stuff for MCA Examinations - NIMCET
Previous Year Question (PYQs)
2
For this kind of declaration of main() function in a C program ‘copy.C’:
int main(int argc, char *argv[]) { }
and this call of main function at command prompt:
C:\tc\bin>copy file1 file2 file3
What will be the value passed in parameter argc?
Solution
Solution:
The **argc (argument count)** includes the program name itself.
So the arguments are:
1️⃣ "copy" (program name)
2️⃣ "file1"
3️⃣ "file2"
4️⃣ "file3"
Thus, total arguments = 4.
Online Test Series, Information About Examination, Syllabus, Notification and More.