2 votes 2 votes sumitbansal asked Jan 15, 2018 sumitbansal 310 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply sumitbansal commented Jan 15, 2018 reply Follow Share guys m not able to understand why it is evaluating in 2's complement form 0 votes 0 votes MiNiPanda commented Jan 15, 2018 reply Follow Share https://stackoverflow.com/questions/17260527/what-are-the-rules-for-casting-pointers-in-c See the 1st answer here to get idea about how type casting of pointers work. Thank you for posting this doubt. Otherwise I wouldn't have known how such things work! :P 2 votes 2 votes vishal chugh commented Jan 16, 2018 reply Follow Share The dereferencing of the pointer 'ptr' will be done in the range of char only. As the range of char is -128 to 127, hence for 255 overflow will occur at 128 and the output will be -128 + 127 = -1. 1 votes 1 votes sumitbansal commented Jan 16, 2018 reply Follow Share thnx bro 0 votes 0 votes Please log in or register to add a comment.