Having the same strings and diffrenet length
Posted: Sat Apr 03, 2010 4:06 pm
Hello I'm Tina.
I had an excel document with names of scientists and I put them in my database(MySQL).
I'm reading from .txt files other names and I'm searching to find if a name I have, there is already in my database.
I used the function strcmp() but it doesn't work in case that I have a name that already exists in my database.
Then I used the function strlen() and I discover that having the same name, the lengths of the same names are different!!!
For example,
From my database-> Theocharis, C. R. (String length1: 33)
From .txt files-> Theocharis, C. R. (String length2: 17)
The strcmp() function returns -1 but the names are same and it should return 0.
What I'm going to do???
I had an excel document with names of scientists and I put them in my database(MySQL).
I'm reading from .txt files other names and I'm searching to find if a name I have, there is already in my database.
I used the function strcmp() but it doesn't work in case that I have a name that already exists in my database.
Then I used the function strlen() and I discover that having the same name, the lengths of the same names are different!!!
For example,
From my database-> Theocharis, C. R. (String length1: 33)
From .txt files-> Theocharis, C. R. (String length2: 17)
The strcmp() function returns -1 but the names are same and it should return 0.
What I'm going to do???