#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/*
C++ header for cin.getline() instead of gets()
*/
#include <string>
#include <iostream>
char* insert_at_front( char* str, unsigned number_char, char c )
{
char* s = ( char* )malloc( strlen( str ) + number_char );
for( unsigned i = 0; i < number_char; ++i )
{
s[ i ] = c;
}
strcpy( s + number_char, str );
s[ strlen( str ) + number_char ] = '\0';
free( str );
return s;
}
int main()
{
char* s;
s = ( char* )malloc( 4 * sizeof( char ) );
std
::cin.
getline( s,
4 );
printf( "%s \n", s );
s = insert_at_front( s, 3, '0' );
printf( "%s \n", s );
free( s );
return 0;
}