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

why we are declare the function in the abstract class even though we are declaring it in Derived class?

1 Answers   TCS,


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

1 Answers  


what's the basic's in dot net

0 Answers   informatics,


Explain virtual inheritance?

0 Answers  


//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }

1 Answers  






what is polymorphism?

4 Answers  


write a program to find 2 power of a 5digit number with out using big int and exponent ?

0 Answers  


How to create a comment page in C #??

2 Answers  


what is a class

6 Answers  


how to swap the variables without using temp and operators

1 Answers  


write a c++ code to overload + and - for a stack class such that + provides push and - provides pop operation

1 Answers   College School Exams Tests, HCL, IBM, TCS,


What is overloading in oop?

0 Answers  


Categories