Program to open a file with First argument



Program to open a file with First argument..

Answer / kishore kumar naik p

void main(int nArgCount, char *szArgVector[])
{
if(nArgCount != 2)
{
printf("\nWorng number of argument\nSynatx: %s
<filename>",szArgVector[0]);
return;
}

FILE *fp = foepn(szArgVector[1],"r+");
//Process the file here
fclose(fp);
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is late bound function call and early bound function call? Differentiate.

2 Answers   Ness Technologies,


what is the difference between class and object?

9 Answers  


c++ program to swap the objects of two different classes

1 Answers  


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1 Answers  


What is operator overloading? Give Example

11 Answers   CTS, IBM, TCS,


What is cohesion in oop?

1 Answers  


How do you define a class in oop?

1 Answers  


Why do we need polymorphism in c#?

1 Answers  


What is the diamond problem in inheritance?

1 Answers  


WAP to generate 2n+1 lines of the following pattern on the computer screen:

2 Answers  


How is class defined?

1 Answers  


what is the definition of incapsulation

2 Answers  


Categories