Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Wednesday, February 10, 2010

fputs function is used to ?

i. write characters to a file
ii. takes 2 parameters
iii. returns a character
iv. requires a file pointer

a) all are true
b) all are false
c) only i and ii are true
d) only i,ii and iv are true


Tuesday, May 12, 2009

1. When the function below is called with a pointer to an open file that contains only three characters A, B and C which one of the following is printed

void listFile( FILE * fp )

{
int c;

while( c = fgetc(fp) != EOF )

{

printf(“%d”, c);

}

printf(“\n”);

}


a. ABC1

b. 1111

c. The characters AB followed by an infinite number of C characters

d. 6566671

e. 0001