Ask coding questions

← Back to all posts
grade book
Boyanhwang

i trying to make a login system but i don't exactly know how to compare strings can someone help?

Voters
Boyanhwang
Comments
hotnewtop
RYANTADIPARTHI

this is how:

that's half the stuff, but here are a few links:

https://www.geeksforgeeks.org/comparing-two-strings-cpp/

Coder100

but thats a string not a c string @RYANTADIPARTHI

Coder100

For example:

is always false
@RYANTADIPARTHI

RYANTADIPARTHI

@Coder100 It is.

Coder100

yes it is @RYANTADIPARTHI

RYANTADIPARTHI
Coder100

@RYANTADIPARTHI so anyways for the c string cmp you should change that

RYANTADIPARTHI

@Coder100, yeah, i didn't give the entire code, just a bit. But I'll change it to the full code.

Coder100

You already got half of it done! Use your cstring library :)

Boyanhwang

@Coder100 Thanks!

codebroken

This is How:

Output:

Check this link -

https://www.scaler.com/topics/comparing-two-strings-in-cpp/

SUHASTADIPARTH1

You can probably use an if statement or logical operators.