The perror() function is used to print a user-defined error message to stderr. Consider the following:
Example:
#include
int main ()
{
FILE * pFile;
pFile=fopen ("missing.txt","rb");
if (pFile==NULL)
perror ("missing.txt");
else
fclose (pFile);
return 0;
}
Possible Output:
missing.txt: No such file or directory
We can achieve the exact same effect with a more verbose fprintf() statement, such that the following are equivalent:
perror ("Error");
fprintf (stderr, "Error: %s\n", strerror (errno));
The following are also equivalent:
perror (NULL);
fprintf (stderr, strerror (errno));
We typically use fprintf() statement when we need to print messages other than those provided by strerror and/or wish to redirect the output to a device other than stderr. But for all error messages based upon the thread-local errno, perror is more concise and reduces the chances of introducing errors through typos (such as accidently redirecting errors to stdout instead of stderr).
since, the word 'void' in C programming language means that it does not return any value to the user or calling function....this is usually used to specify a type of function...... for this reason w use 'void'in c program..
Sizeof is an example.
No.
1. identifier 2. short for function
In C programming, C compiler is user to translate C source into C object module.
since, the word 'void' in C programming language means that it does not return any value to the user or calling function....this is usually used to specify a type of function...... for this reason w use 'void'in c program..
There are no commands in C-programming, you should use function sqrt from math.h
toupper is used to change the case of given character to upper case
Sizeof is an example.
No.
The putpixel function is a specific function that is used in C++ programming. This command function is supposed to do point plotting via color definition of its specific points.
Programming.
1. identifier 2. short for function
it is sqrt in header math.h
In C programming, C compiler is user to translate C source into C object module.
In C programming, a precondition is a condition that must be true before a function is called, while a postcondition is a condition that is guaranteed to be true after the function has been executed.
Programming.