Awesome q2a theme
0 votes

in Programming by (227 points)
closed by | 33 views
int pointer is pointing to characters of a string. So answer should be 3.
what if it would be pointing to int.

why am i getting 6 as answer.
yes then 6 is correct.

actually char is 1 B and int is 2B here.

also we have int pointer and not char pointer. so when we increment the pointer it would jump 2 B i.e. it will point to T then to C and then to /0 and loop will stop.
so we did 3 jumps/ incremented the pointer 3 times.

the other pointer is not incremented even once.

so p1 -p2 = 3
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
8,430 questions
2,707 answers
95,451 users