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

Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?

5 Answers  


What do you mean by pure virtual functions?

8 Answers  


Describe these concepts: Polymorphism, Inheritance and Abstraction.

0 Answers   TCS,


why destructor is not over loaded?

5 Answers  


why c++ is called OOPS? waht is inherutance? what is compiler?

5 Answers  






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

2 Answers   Ness Technologies,


What is oop in simple words?

1 Answers  


What is polymorphism used for?

0 Answers  


What is coupling in oops?

0 Answers  


In multilevel inheritance constructors will be executed from the .... class to ... class

2 Answers   ABCO, TCS,


Is react oop?

0 Answers  


Why do we use oops?

0 Answers  


Categories