질문 드립니다.
main( )
{
:
:
pthread_create( &tid, NULL, function, (void*)arg);
:
}
void* function( void* arg )
{
int val = (int)arg;
이렇게 쓰레드에 argument를 넘겨 줄때 (void*)arg
이런 식으로 넘겨주는데
받을 때
int val = (int)arg;
이렇게 해야지
int val = (int *)arg;
이렇게 쓴다면
warning 이 떨어 집니다.
(initialization makes integer from pointer without a cast)
(int) arg 하면 arg를 정수형으로 변환 하는게 아닌지요?