+ added CMakeLists.txt

+ added headers
+ added library 'add_main.c'
+ some optimization
This commit is contained in:
arcan1s
2013-07-22 06:06:01 +04:00
parent 2057208ef6
commit 51d31d0a2f
22 changed files with 347 additions and 210 deletions

23
statgen/int2char.c Normal file
View File

@ -0,0 +1,23 @@
/* Library for converting integer to string
* Usage
* char = conv (number, position)
*/
char conv (const int fnumb, const int dig_pos)
/* fnumb - integer
* dig_pos - position
*/
{
int d, h, o;
char const digit[] = "0123456789";
h = fnumb / 100;
d = (fnumb % 100) / 10;
o = fnumb % 10;
if (dig_pos == 1) return digit[o];
if (dig_pos == 2) return digit[d];
if (dig_pos == 3) return digit[h];
else return digit[0];
}