codescracker


c

C perror()



« Previous Function Next Function »


perror()

The perror() function maps the value of global variable errno onto a string and writes that string to the stderr. If value of str is not null, string is written first, followed by a colon and then the implementation-defined error message.

perror() Syntax

#include<stdio.h>
void perror(const char *str);

perror() Example

Following c code reports any I/O error that may have occurred on the stream associated with fp :

if(ferror(fp))
{
	perror("File error ");
}

« Previous Function Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test