How can I open files mentioned on the command line, and parse option flags?



How can I open files mentioned on the command line, and parse option flags?..

Answer / Virender Kumar Tiwari

To open files mentioned on the command line in C, you can use the argv array provided by main() function. For parsing option flags, consider using libraries like getopt or libcommandline for a more robust solution.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How many ways are there to swap two numbers without using temporary variable? Give the each logic.

9 Answers  


can you change name of main()?how?

3 Answers   HCL, Siemens,


code for selection sort?

1 Answers  


what is the difference between <stdio.h> and "stdio.h"

14 Answers   Invendis, Kanbay, Mastek, MathWorks,


how would a 4*3 array A[4][3] stored in Row Major Order?

0 Answers   HCL, Ignou,


What is the significance of an algorithm to C programming?

1 Answers  


Why is struct padding needed?

1 Answers  


how to devloped c lenguege?

4 Answers  


What is static function in c?

1 Answers  


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1 Answers  


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1 Answers  


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1 Answers  


Categories