The Code is compiling without Error/Bug/Exception..,ITYM
What are the possibilities for this behaviour?
//************************************************** *************
#include<stdio.h>
typedef struct abc_ *abc;
static abc param;
abc fun(void)
{
float *a = NULL;
a = (float *)malloc(sizeof(float));
if (a) {
return ((abc)(a));
}
return NULL;
}
int main()
{
param = fun();
printf("test_bandwidth_alloc: %x\n", param);
free(param);
}

#include <stdio.h>
#include <stdlib.h /* Required for malloc() and free() */
typedef struct abc_ *abc;
static abc param;
abc fun(void)
{
/* Don't cast malloc, don't give types to sizeof */
float *a = malloc(sizeof *a);
if(a)
return (abc) a; /* Cleaned up, this is very suspicious.. */
return NULL;
}
int main(void)
{
param = fun();
/* You used %x, which you can't pass a pointer to. Use %p instead: */
printf("test_bandwidth_alloc: %p\n", (void *) param);
free(param);
}
--
Andrew Poelstra <ap*******@wpsoftware.com>
To email me, change .net to .com in the above address.
I just realized my reader isn't hiding my real address...