How to compare the string in if con | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How to compare the string in if con

I want it to show ye when I input 1 but its always show nee

5th Nov 2019, 10:50 AM
Pubas Deedumrong
Pubas Deedumrong - avatar
2 Respostas
+ 1
"==" checks if both strings are pointing to same address. You can use strcmp to compare two strings. if(strcmp("hi", "hi") == 0) { }
5th Nov 2019, 11:20 AM
Jakub Stasiak
Jakub Stasiak - avatar
5th Nov 2019, 10:51 AM
Pubas Deedumrong
Pubas Deedumrong - avatar