Aspire Faculty ID #13675 · Topic: JAMIA MILLIA ISLAMIA MCA 2023 · Just now
JAMIA MILLIA ISLAMIA MCA 2023

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.

Previous 10 Questions — JAMIA MILLIA ISLAMIA MCA 2023

Nearest first

Next 10 Questions — JAMIA MILLIA ISLAMIA MCA 2023

Ascending by ID
Ask Your Question or Put Your Review.

loading...