physics chemistry maths science forums
become expert I help I sign up I login
refer a friend - earn nickels!!   
 advanced
 
Home
Ask & Discuss Questions
Study Material
Experts Zone
Hang Out!

Ask & Discuss Questions with Community & Experts

Moderation Team
 90 chars left    advanced
Ask iit jee aieee pet cbse icse state board community Community Discussion Question: Computer Science....BOARDS.....PRACTISE...........
Forum Index -> Computer Science like the article? email it to a friend.  
Author Message
sugargal_anu (169)

Hot goIITian

Olaaa!! Perrrfect answer. 31  [38 rates]

sugargal_anu's Avatar

total posts: 135    
offline Offline
sneha and anu, both of u r rite.

Orkut Graphics - Angels
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
paddy.dude (1023)

Blazing goIITian

Olaaa!! Perrrfect answer. 155  [279 rates]

paddy.dude's Avatar

total posts: 1302    
offline Offline
hey anusha can u explain the second line in the output...........how can it be 11,12 etc
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Nithy (395)

Blazing goIITian

Olaaa!! Perrrfect answer. 65  [100 rates]

Nithy's Avatar

total posts: 393    
offline Offline
bcoz *ptr + 1.
increments value of *ptr.
this remains unchanged = 0 th element 10.
only i changes 1 - 5.

NOT *(ptr+1) like before. note the paranthesis!!!!!!!!!!!

" From ashes a fire shall be woken From shadows a light shall spring " ---Tolkien

" Throughout the centuries there were men who took first steps down new roads armed with nothing but their own vision. " --- Ayn Rand

 this reply: 2 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
varshavallig (798)

Blazing goIITian

Olaaa!! Perrrfect answer. 136  [195 rates]

varshavallig's Avatar

total posts: 509    
offline Offline
*ptr means value of ptr which is 10.now increasing it by 1,2,3,4 gives 11 12 13 14 .
!!!!!!!!!!!!!!!

Varsha
be cool,
tomorrow is what we make it today,
so if u can dream it , u can make it .
life is an ice cream ,eat it before it melts away!!!!!!!!!
varsha

SmileyCentral.com




 this reply: 2 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
paddy.dude (1023)

Blazing goIITian

Olaaa!! Perrrfect answer. 155  [279 rates]

paddy.dude's Avatar

total posts: 1302    
offline Offline
oh now got it.............thnks
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2288)

Blazing goIITian

Olaaa!! Perrrfect answer. 410  [529 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
this one is really a gud one.........

#include
#include
void main()
{
int arr[] = { 10 , 20 , 30 , 40 , 50 }

int *p, **q , *t ;

p = arr ;
t = arr + 1;
q = & t ;

cout<< * p <<" , " << ** q << " , " << * t++ ;
}

have a try at this........gud luck.....

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
sneha.bagri (142)

Blazing goIITian

Olaaa!! Perrrfect answer. 24  [35 rates]

sneha.bagri's Avatar

total posts: 378    
offline Offline
is d output
10,30,20
???????
 this reply: 2 points  (with Olaaa!! Perrrfect answer.   in 1 votes )   [?]
 
You have to be logged on to rate
  
varshavallig (798)

Blazing goIITian

Olaaa!! Perrrfect answer. 136  [195 rates]

varshavallig's Avatar

total posts: 509    
offline Offline
is it
10 20 30
????
!!!!!!!!!!!

Varsha
be cool,
tomorrow is what we make it today,
so if u can dream it , u can make it .
life is an ice cream ,eat it before it melts away!!!!!!!!!
varsha

SmileyCentral.com




 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
paddy.dude (1023)

Blazing goIITian

Olaaa!! Perrrfect answer. 155  [279 rates]

paddy.dude's Avatar

total posts: 1302    
offline Offline
is it 10,20,20
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
Aatish (2288)

Blazing goIITian

Olaaa!! Perrrfect answer. 410  [529 rates]

Aatish's Avatar

total posts: 1102    
offline Offline
Sneha is absolutely correct.....

it is because.....as in cout statement.....*t++ occurs....and evaluation takes place from left hand side.....then q which was an alias name for t....has now moved to next place..i.e 30........

............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
sugargal_anu (169)

Hot goIITian

Olaaa!! Perrrfect answer. 31  [38 rates]

sugargal_anu's Avatar

total posts: 135    
offline Offline
This programs just wat i'd posted in 2nd page. just the array's names different & ive an extra variable thats 2 b printed.

Orkut Graphics - Angels
 this reply: 0 points  (with Olaaa!! Perrrfect answer.   in 0 votes )   [?]
 
You have to be logged on to rate
  
 
Forum Index -> Computer Science
Go to:   

Top Offers for goIITians
Correspondence Courses
Brilliant Tutorials
Narayana Institute
Aakash Institute
Classroom/Crash Courses
Narayana - Kota , Delhi , Others
Brilliant Tutorials - Class , Crash
Aakash Institute - Medical , Engg
Online Test Series
Brilliant Tutorials
Narayana Institute
Aakash Institute
Mahesh Tutorials
AMITY      Sri Chaitanya