Roman Numeral Conversion API 0.0.4

Roman Numeral Conversion API project was developed to provide an easy method of including Roman Numeral values...
Roman Numeral Conversion API project was developed to provide an easy method of including Roman Numeral values in the output of programs written in C/C . There are example programs that demonstrates the use of the functions included in the library. The utilities `romannum' and `romandate' show possible uses for the functions as well as provide silly tools to play with.

Programming Examples

The first example demonstrates generating Roman Numeral strings from an integer:

/* compile with gcc -lroman -o test1 test1.c */
#include
#include

int main(void);

int main(void)
{
const char * roman;
roman = long2roman(3132);
if (!(roman))
{
perror("long2roman()");
return(1);
};
printf("Roman Numeral: %sn", roman);
return(0);
}

If the above program is run on a Posix system, the output should be similiar to the following:

syzdek@tacntock$ gcc -lroman -o test1 test1.c
syzdek@tacntock$ ./test1
Roman Numeral: MMMCXXXII
syzdek@tacntock$

The second example demonstrates converting a Roman Numeral string into an integer:

/* compile with gcc -lroman -o test2 test2.c */
#include
#include

int main(void);

int main(void)
{
int num;
num = roman2long("MMMCXXXII");
if (num < 0)
{
perror("roman2long()");
return(1);
};
printf("Number: %in", num);
return(0);
}


If the above program is run on a Posix system, the output should be similiar to the following:

syzdek@tacntock$ gcc -lroman -o test2 test2.c
syzdek@tacntock$ ./test2
Number: 3132
syzdek@tacntock$

Additional examples are included in the `examples' directory.

last updated on:
February 3rd, 2008, 0:49 GMT
price:
FREE!
homepage:
roman.sourceforge.net
license type:
GPL (GNU General Public License) 
developed by:
David M. Syzdek
category:
ROOT \ Utilities
Roman Numeral Conversion API
Download Button

In a hurry? Add it to your Download Basket!

user rating 14

2.7/5
 

0/5

Rate it!

Add your review!

SUBMIT