Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > DATA STRUCTURES, C, C++, VC ++ > ds. c , c++ Interview / Technical Questions
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

ds. c , c++ Interview / Technical Questions Kindly solve an many as questions you can. It will sharpen your skills and those solutions will help others too.

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 02-04-07, 03:17 PM   #1 (permalink)
Senior Member
 
Join Date: Oct 2006
Location: In Bangalore
Age: 24
Posts: 126
Thanks: 1
Thanked 6 Times in 6 Posts
Thanks: 1
Thanked 6 Times in 6 Posts
Rep Power: 0 jithendra.b will become famous soon enough
Pointer question

Guess the o/p of the following

main()
{
static int a[] = {0,1,2,3,4};
static int *p[] = {a,a+1,a+2,a+3,a+4};
int **ptr = p;
ptr++;
printf("\n%d%d%d",ptr-p,*ptr-a,**ptr);

*ptr++;
printf("\n%d%d%d",ptr-p,*ptr-a,**ptr);

*++ptr;
printf("\n%d%d%d",ptr-p,*ptr-a,**ptr);

++*ptr;
printf("\n%d%d%d",ptr-p,*ptr-a,**ptr);
}

NOTE : Always remember that the values are evaluated from right to left in a function.
jithendra.b is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-06-07, 04:41 PM   #2 (permalink)
Junior Member
 
Join Date: May 2007
Age: 23
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 2 anubhav1109 is on a distinguished road
Re: Pointer question

output is:-
1 1 1
2 2 2
3 3 3
3 4 4
anubhav1109 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 13-08-07, 04:13 PM   #3 (permalink)
Junior Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 Renu Aggarwal is on a distinguished road
Re: Pointer question

i want to know how to study data structures. i want to start?????????????????
Renu Aggarwal is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 13-08-07, 09:53 PM   #4 (permalink)
Junior Member
 
Join Date: May 2007
Age: 23
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 2 anubhav1109 is on a distinguished road
Re: Pointer question

hi....its better if u start wid Classical Data Structure by D.Samanta along wid data Structure by schaum series
anubhav1109 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
C language - Difference between Funtion to pointer and pointer to function GEEK ds. c , c++ Interview / Technical Questions 1 07-08-07 10:08 AM
TATA ELAXSI placement paper 2 sridhar TATA ELXSI Placement Papers 0 12-02-07 04:10 PM
INFOSYS Placement paper 119 sridhar INFOSYS Placement Papers 0 08-02-07 03:39 PM
Bob Technologies placement paper 1 sridhar BOB TECHNOLOGIES Placement Papers 0 03-02-07 07:42 PM
Interview questions you may be asked yathish HR Questions 6 24-12-06 08:35 PM


All times are GMT +6.5. The time now is 12:39 PM.





Search Engine Optimization by vBSEO 3.1.0