Forums.Sureshkumar.net : A Perfect Place to Share Knowledg Blogs   Games  Magazines   click here

"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 > Interview Questions > Interview Questions > C
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

C C Interview Questions asked in various Interviews. Professionals are invited to share Answers for these C Interview Questions. C Interview Questions with answers, Experiences, Career Advices, Tips and more.

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 14-06-08, 02:25 AM   #1 (permalink)
Senior Member
 
Join Date: Apr 2008
Posts: 13,563
Thanks: 0
Thanked 9 Times in 9 Posts
Thanks: 0
Thanked 9 Times in 9 Posts
Rep Power: 137 ShivaniX is on a distinguished road ShivaniX is on a distinguished road
Are pointers really faster than



Are pointers really faster than arrays? How much do function
calls slow things down?

ShivaniX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 14-06-08, 12:27 PM   #2 (permalink)
Member
 
Join Date: Oct 2007
Age: 22
Posts: 65
Thanks: 0
Thanked 4 Times in 4 Posts
Thanks: 0
Thanked 4 Times in 4 Posts
Rep Power: 2 asili prasanna will become famous soon enough
Re: Are pointers really faster than

The pointer accessing method is more faster than array indexing.
asili prasanna is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 29-10-08, 02:30 PM   #3 (permalink)
Junior Member
 
Join Date: Oct 2008
Age: 24
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 1 retheeshsoman is on a distinguished road
Re: Are pointers really faster than

It is "usually" faster to march through large arrays with pointers rather than array subscripts, but for some processors the reverse is true.
Function calls, though obviously incrementally slower than in-line code, contribute so much to modularity and code clarity that there is rarely good reason to avoid them.
Before rearranging expressions such as i = i + 1, remember that you are dealing with a C compiler, not a keystroke-programmable calculator. Any decent compiler will generate identical code for ++i, i += 1, and i = i + 1. The reasons for using ++i or i += 1 over i = i + 1 have to do with style, not efficiency.
retheeshsoman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
c language , interview questions



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 On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What happens to the member pointers when ShivaniX C Plus Plus 0 12-06-08 12:55 PM
what is pointers ShivaniX C 0 11-06-08 08:28 PM
Which of the above methods is the faster method sandeepkumar141 Oracle General 0 04-06-08 12:30 PM
To what value are pointers initialized ShivaniX C 0 25-05-08 04:36 AM
Features Removed from C and C++ TAM JAVA Technologies 1 27-09-07 06:35 PM


All times are GMT +6.5. The time now is 06:28 PM.




Get Short Listed Fast !! Upload Your CV here & Apply New Jobs Everyday.

Search Engine Optimization by vBSEO 3.1.0