如何用相等运算符比较两个字符串。我也在 GNOMEglib
库中看到过。他们用运算符比较两个字符串==
。这是代码:
/* Code from Singly Linked List - gslist.c*/
GSList*
g_slist_find (GSList *list,
gconstpointer data) // Here gconstpointer is `const void*`
{
while (list)
{
if (list->data == data) // What is compare here?
break;
list = list->next;
}
return list;
}
那么,glib 代码是否总是有效?