The function has several drawbacks.
For starters you do not take into account the terminating zero '\0' for the allocated string.
Secondly, the user can enter 0 as a number. In this case the value of dcount will be incorrect because the loop
while (temp != 0) {
temp /= 10;
dcount++;
}
will be skipped.
Thirdly, the function will not correctly process negative numbers and the user is allowed to enter a negative number.
This declaration
char **string2 = &string;
is redundant. You could call the function the following way
Conversion( &string );
It is not the function that should ask the user to enter a number. The function should do only one task: convert an integer number to a string.
And one more function design drawback.
From the function declaration
int Conversion(char **string);
(that should precede the function main) it is unclear whether the user should provide memory for the string or it is the function that allocates memory for the string.
A better interface of the function can look the following way as it is shown in the demonstrative program below.
#include <stdio.h>
#include <stdlib.h>
char * Conversion( int x )
{
const int Base = 10;
size_t digits = x < 0 ? 1 : 0;
int tmp = x;
do
{
++digits;
} while ( tmp /= Base );
char *s = malloc( digits + sizeof( ( char )'\0' ) );
if ( s != NULL ) sprintf( s, "%d", x );
return s;
}
int main( void )
{
int num = 0;
printf( "Enter a number: " );
scanf( "%d", &num );
char *s = Conversion( num );
if ( s != NULL )
{
printf( "The entered number converted to string: %s\n", s );
}
else
{
puts( "A conversion error ocured." );
}
free( s );
}
Its output might look the following way
Enter a number: -12
The entered number converted to string: -12
Take into account that according to the C Standard the function main without parameters shall be declared like
int main( void )