Awesome q2a theme
0 votes
27 views

in Programming by (122 points) | 27 views
0

https://csedoubts.gateoverflow.in/9139/pointer-assignment

same concept. It would generate 1006 as output.

1 Answer

+1 vote
Best answer
let suppose   $int$ $a = 5$  and size of int is $4B$ and add of a is 1000 then
$a+1$ then it will be $6$.
$&a+1 $ means address of $a$ +  size of $a$ $= 1000+4 = 1004$
--------------

Come to Question , here $s$ is an array and size of $s$ is $6B$.
$&s+1$ $= 1000+6$
$int$ $*str = $$(int $ $*)1006$ //Array pointer is typecasted to integer pointer.

Now $str$ contain 1006.

It will print $1006$.

let me know if i missed something.
ago by (64 points)
selected ago by
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.
Top Users Dec 2019
  1. Pratyush Priyam Kuan

    158 Points

  2. Vimal Patel

    118 Points

  3. avistein

    65 Points

  4. srestha

    54 Points

  5. Mk Utkarsh

    49 Points

  6. arya_stark

    46 Points

  7. goxul

    39 Points

  8. Sathuri Bharath

    34 Points

  9. vishal burnwal

    31 Points

  10. Shaik Masthan

    26 Points

Monthly Top User and those within 60% of his/her points will get a share of monthly revenue of GO subject to a minimum payout of Rs. 500. Current monthly budget for Top Users is Rs. 75.
2,314 questions
1,294 answers
6,592 comments
89,719 users