demande de précision sur * (suite)
Bonsoir à tous!
A la suite d'un précédent "post" j'ai appris que:
type* variable et type *variable sont le même chose. Pourtant, en faisant des essais sur les threads de la glib voila ce qui ce passe:
Code:
1 2 3 4
|
GThread *thread1,*thread2;
thread1=g_thread_create((GThreadFunc)f,p_str,TRUE,NULL);
thread2=g_thread_create((GThreadFunc)f,p_str,TRUE,NULL); |
Compilation sans probleme.
Code:
1 2 3 4
|
GThread* thread1,thread2;
thread1=g_thread_create((GThreadFunc)f,p_str,TRUE,NULL);
thread2=g_thread_create((GThreadFunc)f,p_str,TRUE,NULL); |
Citation:
/home/.../main.cc||In function \int main()\:|
/home/.../main.cc|30|erreur: no match for \operator= in thread2 = g_thread_create_full(((void* (*)(void*))f), ((void*)p_str), 0u, 1, 0, G_THREAD_PRIORITY_NORMAL, 0u)
/usr/include/glib-2.0/glib/gthread.h|60|note: candidats sont: _GThread& _GThread::operator=(const _GThread&)|
/home/.../main.cc|33|erreur: cannot convert GThread to GThread* for argument to void* g_thread_join(GThread*)|
||=== Build finished: 2 errors, 0 warnings ===|
Bien sur, si je déclare :
Code:
1 2 3
|
GThread* thread1;
GThread* thread2; |
Il n'ya plus de problème. Mais tout de même..."type* v" et "type *v". C'est pas vraiment pareil. Non?