0 votes 0 votes https://www.sanfoundry.com/c-program-checks-strings-anagrams/ what is the meaning of line number 32? himgta asked Feb 19, 2019 himgta 370 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Shaik Masthan commented Feb 19, 2019 reply Follow Share int num1[26] = {0}, num2[26] = {0}, i = 0; it means, num1 is array of 26 integers, the indexes indirectly specifies that, num1[0] = number of occurances of 'a' num1[1] = number of occurances of 'b' ... etc num1 is for string1, and num2 is for string2. at the end he will compare num1[i]==num2[i] or not, if for every index it holds then those strings are anagrams ! coming to your doubt:- num1[array1[i] - 'a']++; array1[i] means the character in the string and subtracting 'a' means getting it's index value in the num1[]. How ? let my string is "masthan" , array[0]='m' and array[1]='a' and array[2]='s' and array[3]='t' and array[4]='h' and array[5]='a' and array[6]='n' let the i is the 3, then num1[array1[3]-'a']++; ===> num1['t'-'a']++; t=116 (as per ascii) and a = 97 ==> 't'-'a' = 116-97=19 which is the index of t therefore num[19]++; 2 votes 2 votes himgta commented Feb 20, 2019 reply Follow Share Thank u brother! 0 votes 0 votes Please log in or register to add a comment.