The standard error(stderr) stream is the default destination for error messages and other diagnostic warnings. Like stdout, it is usually also directed to the output device of the standard console (generally, the screen).
Discuss About this Question.
Which standard library function will you use to find the last occurance of a character in a string in C?
A:
strnchar()
B:
strchar()
C:
strrchar()
D:
strrchr()
Answer:D
strrchr() returns a pointer to the last occurrence of character in a string.
Example:
#include <stdio.h>
#include <string.h>
int main()
{
char str[30] = "12345678910111213";
printf("The last position of '2' is %d.\n",
strrchr(str, '2') - str);
return 0;
}
Output: The last position of '2' is 14.
Discuss About this Question.
Input/output function prototypes and macros are defined in which header file?
A:
conio.h
B:
stdlib.h
C:
stdio.h
D:
dos.h
Answer:C
stdio.h, which stands for "standard input/output header", is the header in the C standard library that contains macro definitions, constants, and declarations of functions and types used for various standard input and output operations.
Discuss About this Question.
What will the function rewind() do?
A:
Reposition the file pointer to a character reverse.
B:
Reposition the file pointer stream to end of file.
C:
Reposition the file pointer to begining of that line.
D:
Reposition the file pointer to begining of file.
Answer:D
rewind() takes the file pointer to the beginning of the file. so that the next I/O operation will take place at the beginning of the file.
Example: rewind(FilePointer);
Discuss About this Question.
Ad Slot (Above Pagination)
Install ExamAdept
Fast access — add this app to your device.
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.