+ 2

array in c

how can check the first character of array and two character before of las t character, those are equal or not??? For example, BANGLA in this word 2nd and last character same. How can do that???

22nd Mar 2018, 8:34 PM
sk sakib
sk sakib - avatar
4 Antworten
+ 1
c
22nd Mar 2018, 9:01 PM
sk sakib
sk sakib - avatar
0
What programming language? The methods are different
22nd Mar 2018, 9:00 PM
Ariela
Ariela - avatar
0
I’m pretty bad at C, so I’ll do it in C++ std::string string = “BANGLA”; if(string[0] == string[string.length-1]){ //will be true for bangla std::cout << “Same Letter” << std::endl; }
22nd Mar 2018, 9:17 PM
Ariela
Ariela - avatar
0
tnx
22nd Mar 2018, 9:18 PM
sk sakib
sk sakib - avatar