User Tools

Site Tools


c:string.h:strerror
click
to support this page (eg 0,42 € or so) Thanks.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:string.h:strerror [2012/07/16 22:41]
127.0.0.1 external edit
c:string.h:strerror [2013/02/17 00:49] (current)
Daniel Gohlke
Line 1: Line 1:
-    char *strerror(int errnum);+{{keywords>wiki library source code example reference}} 
 +====== strerror ====== 
 +<code c> 
 +#include <string.h> 
 +//#include <windows.h> /* uncomment this for Windows */ 
 +char *strerror(int errnum); 
 +</code> 
 + 
 +=== Description === 
 +returns a pointer to a string that describes the error code passed in the argument errnum 
 + 
 + 
 + 
 +compile this example with the compiler flag **-lm** 
 +===== strerror C Example Code ===== 
 +<code c> 
 +/*  
 + * strcspn c example code 
 + * http://code-reference.com/c/string.h/strerror 
 + */ 
 +#include <stdio.h> 
 +#include <string.h> 
 +#include <errno.h> 
 +#include <math.h> 
 + 
 +int main ( void ) { 
 + 
 +double i; 
 +i = sqrt(-1); 
 +printf("sqrt(-1)=%f\n",i); 
 +printf("%s\n", strerror(errno)); 
 +return 0; 
 +
 + 
 +</code> 
 + 
 + 
 +=== Output of strerror example === 
 +    sqrt(-1)=-nan 
 +    Numerical argument out of domain 
 + 
 +    
advertising
c/string.h/strerror.txt · Last modified: 2013/02/17 00:49 by Daniel Gohlke

Impressum