3
I’m in doubt on a line of code:
if(strcmp(novo->nome,aux->nome)>=0)
How does your comparison occur? Being that the name is a char!
3
I’m in doubt on a line of code:
if(strcmp(novo->nome,aux->nome)>=0)
How does your comparison occur? Being that the name is a char!
3
The strcmp method tests the equality of strings.
The method declaration is as follows::
int strcmp ( const char * str1, const char * str2 );
So returns an integer.
Soon, in your code, will enter the scope of if when novo->nome is equal to or greater than aux->nome
Browser other questions tagged c
You are not signed in. Login or sign up in order to post.
Being
nomea char, that statement has error. With the#include <string.h>compiler detects error and warns programmer.– pmg
@pmg error why?
– Jorge B.
@Jorgeb.: Mistake because the guy
charis not compatible with the typechar *. The functionstrcmp()compares the content of two pointers; not the value of two characters.– pmg