C-Command Line Arguments
C-Command Line Arguments
1. The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
- 128 characters
- 256 characters
- 67 characters
- It may vary from one operating system to another
2. According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
- int main(int argc, char *argv[])
- int main(argc, argv) int argc; char *argv;
- int main() { int argc; char *argv; }
- None of above
3. What do the 'c' and 'v' in argv stands for?
- 'c' means argument control 'v' means argument vector
- 'c' means argument count 'v' means argument vertex
- 'c' means argument count 'v' means argument vector
- 'c' means argument configuration 'v' means argument visibility
4. Find the output
#include "stdio.h"
void main ( )
{
int x;
fopen ("raja.txt","w");
fopen("milu.txt", "w");
x=FOPEN_MAX;
printf("%d", x);
}
#include "stdio.h"
void main ( )
{
int x;
fopen ("raja.txt","w");
fopen("milu.txt", "w");
x=FOPEN_MAX;
printf("%d", x);
}
- 2
- 7
- 20
- None of these
5. The files linked and accessed through the library functions are known as
- Low level files
- Stream oriented files
- Library files
- None of the above
6. The files linked and accessed using system calls are known as
- Stream oriented files
- System oriented files
- High level files
- None of the above
7. Find the output
#incude "stdio.h"
void main ()
{
FILE *p;
p=fopen ("raja. txt", "w");
printf("%d", p->fd);
}
#incude "stdio.h"
void main ()
{
FILE *p;
p=fopen ("raja. txt", "w");
printf("%d", p->fd);
}
- 5
- 6
- 7
- None of these
8. What is the content of the file ?
#include "stdio.h"
void main ( )
{
FILE *p;
p=fopen ("letter.txt", "wt");
putc('Go',p);
putc ('od',p);
rewind(p);
putc(Fo',p);
putc('Fo',p);
fclose(p);
}
#include "stdio.h"
void main ( )
{
FILE *p;
p=fopen ("letter.txt", "wt");
putc('Go',p);
putc ('od',p);
rewind(p);
putc(Fo',p);
putc('Fo',p);
fclose(p);
}
- Food
- FoGood
- Fo
- No output
9. Which of the following functions is most appropriate for storing numbers in a file ?
- putc ( )
- fprintf( )
- fwrite ( )
- None of these
10. Which of the following is not true about ftell?
- it is a function
- Gives the current file position indicator.
- Can be used to find the size of a file.
- it is meant for checking whether a given file exists or not.