SourceForge Links: Summary Tracker Browse CVS Download |
Roman Numeral Conversion API |
ROMAN NUMERAL APINAMEint2roman, int2roman_r − convert signed int to ASCII string containing the Roman Numeral value LIBRARYRoman Numeral Conversion API (libroman, -lroman) SYNOPSIS#include <roman.h> const char
* char *
DESCRIPTIONThe function int2roman takes an argument of num and returns a pointer to a string containing the integer’s Roman Numeral representation of the integer’s value. Subsequent calls to int2roman will overwrite previous values. The function int2roman_r provides the same functionality as int2roman, except that the caller must provide the out buffer buff to store the result. buff must be at least len characters long. RETURN VALUESIf successful, int2roman and int2roman_r return a pointer to a string containing the Roman Numeral representation of the value of num. If there is an error, they will return a NULL pointer and set errno to indicate the error condition. ERRORS
ENOBUFS Insufficient storage space available in str. EXAMPLES#include
<stdio.h> int main(int argc, char * argv[]); int
main(int argc, char * argv[]) for(i
= 1; i < argc; i++) ptr =
int2roman(num); ptr =
int2roman_r(num, buff, 512);
return(0);
REPORTING BUGSReport bugs to <syzdek@users.sourceforge.net>. COPYRIGHTCopyright (C)
2007 David M. Syzdek. SEE ALSOroman(7), romandate(1) romannum(1) roman2int(3) roman_ctime(3) roman_strftime(3) |