Refactor bigints, add int and float conv functions
Added functions to convert from/to ints/floats. Floats are converted according to basic Steele&White algorithm (without speedup).
This commit is contained in:
21
src/String/Core.c
Normal file
21
src/String/Core.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <BH/String.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
void BH_StringFree(char *string)
|
||||
{
|
||||
free(string);
|
||||
}
|
||||
|
||||
|
||||
char *BH_StringCopy(const char *string)
|
||||
{
|
||||
char *result;
|
||||
|
||||
result = malloc(strlen(string) + 1);
|
||||
if (result)
|
||||
strcpy(result, string);
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user