Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想比较两个 Gtk 小部件指针值是否相等。我该怎么做?无法处理正常的相等(==)或将其类型转换为 int ...
GtkWidget *a; GtkWidget *b; if((int)a == (int)b) { /* ... */ }
指针是指针。如果a指向一个小部件,并且b指向同一个小部件,那么您可以使用if (a == b).
a
b
if (a == b)