V
vaysagekv
I have a function like below.The program has compiled without any errors
..But when I run it I am getting Error like this --->fibBigNumbers(1868)
malloc: *** error for object 0x100000ee2: pointer being freed was not
allocated
*** set a breakpoint in malloc_error_break to debug
021Abort trap.
Program:
void fibonacci(void)
{
static char* i = "1";
static char* j = "1";
char* fib = addBigNumbers(i,j);
printf("\n%s",fib);
char* temp = i;
i=j;
j=fib;
if (!strcmp(temp,"1"))
{
free(temp);
temp = NULL;
}
}
Please Help.
Thanks in Advance.
..But when I run it I am getting Error like this --->fibBigNumbers(1868)
malloc: *** error for object 0x100000ee2: pointer being freed was not
allocated
*** set a breakpoint in malloc_error_break to debug
021Abort trap.
Program:
void fibonacci(void)
{
static char* i = "1";
static char* j = "1";
char* fib = addBigNumbers(i,j);
printf("\n%s",fib);
char* temp = i;
i=j;
j=fib;
if (!strcmp(temp,"1"))
{
free(temp);
temp = NULL;
}
}
Please Help.
Thanks in Advance.