0 votes 0 votes what does following code mean if j=0 and a and b are two character pointers to two strings: while(a[j]&&b[j]) nabadeep asked Apr 27, 2017 nabadeep 609 views answer comment Share Follow See 1 comment See all 1 1 comment reply Gaur_52 commented Feb 11, 2022 reply Follow Share It means that the loop is iterating over two arrays, that are supposed to have at least one, zero element each While iterating over the arrays, as the control reaches on the point where both elements are 0, Loop will exit 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes Since the value of j is 0, therefore the character pointer to string entails the first element of both the strings. And until their value is true. I hope the description helps u. :). For more information visit the link mentioned below. :) http://stackoverflow.com/questions/15168771/pointer-to-a-string-in-c Devshree Dubey answered Apr 27, 2017 Devshree Dubey comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes what does following code mean if j=0 and a and b are two character pointers to two strings: while(a[j]&&b[j]) if j=0 while(a[0] && b[0]) it means the character at location a[0] ans b[0] would be check by its ASCII value if both of them are positiove so there will be while loop run throghout the condition is true. akankshadewangan24 answered May 1, 2017 akankshadewangan24 comment Share Follow See 1 comment See all 1 1 comment reply Arjun commented May 1, 2017 reply Follow Share It is better to say "character code" and not ASCII value as ASCII value is just one of the possible character code in C. For exams like GATE, no question will be asked where one needs to know ASCII code. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes It means that the loop is iterating over two arrays, that are supposed to have at least one, zero element each While iterating over the arrays, as the control reaches on the point where both elements are 0, Loop will exit Gaur_52 answered Feb 11, 2022 Gaur_52 comment Share Follow See all 0 reply Please log in or register to add a comment.