+ 9

[solved]Why this code is showing warning.

If I use the condition if(a[i]=='x') instead of if(*(a+i)=='x') in the following code. It is showing some warning. Can any one explain how to correct it.. here I used this condition for checking equality of letter 'a' in the code below. Here x is some alphabet https://code.sololearn.com/cPGorQ1IjH56/?ref=app

10th Apr 2020, 9:21 AM
Puthur Harthik
4 Antworten
+ 2
You declared I as char, not int.
10th Apr 2020, 9:53 AM
Jayakrishna 🇮🇳
+ 4
Thanks sir I didn't notice that..
10th Apr 2020, 9:55 AM
Puthur Harthik
+ 4
Thanks a lot
10th Apr 2020, 9:56 AM
Puthur Harthik
+ 1
You're welcome.. Good practice. Nice code..
10th Apr 2020, 9:56 AM
Jayakrishna 🇮🇳