Gcc error, invalid use of void expression

void *foo(void *a)
{
        a = (int *)a;
        (*a)PP;
        printf( "a = %d\n", *a);
}
The

program is like this, always saying that there are errors in the second and third lines!

C
Apr.05,2021

an is void*, and cannot be dereferenced. In addition, the sentence a = (int*) a; is meaningless. You change a to int* , then assign it to a, and then become void * La


.

C is a statically typed language. When you specify void * a , an is always void * within its valid domain. When you want to use int * , just use a new variable. For example:

void *foo(void *a)
{
        int *b = (int *)a;
        (*b)PP;
        printf("a = %d\n", *b);
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5f981-671e3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5f981-671e3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?