ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Which command is more efficient?
*(ptr+1) or ptr[1]
 Question Submitted By :: Richmike
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Which command is more efficient? *(ptr+1) or ptr[1]
Answer
# 1
*(ptr+1)
 
Is This Answer Correct ?    2 Yes 1 No
Priya
 
  Re: Which command is more efficient? *(ptr+1) or ptr[1]
Answer
# 2
*(ptr+1);
Internally the same operation is performed with the next 
one also.
it takes less time.
 
Is This Answer Correct ?    0 Yes 1 No
Purna
 
 
 
  Re: Which command is more efficient? *(ptr+1) or ptr[1]
Answer
# 3
If ptr is declared as a pointer like int *ptr; *(ptr+1) is 
more efficient.
If ptr is declared as an array like int ptr[20]; ptr[1] is 
more efficient.
So, it depends upon how we r declaring ptr as a pointer or 
as an array.
 
Is This Answer Correct ?    0 Yes 1 No
Poornima
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What ios diff. Between %e & %f? Honeywell1
Convert the following expression to postfix and prefix (A+B) * (D-C) Satyam2
what is the advantage of software development  1
int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? Verifone14
There is a 100-story building and you are given two eggs. The eggs (and the building) have an interesting property that if you throw the egg from a floor number less than X, it will not break. And it will always brake if the floor number is equal or greater than X. Assuming that you can reuse the eggs which didn't broke; you got to find X in a minimal number of throws. Give an algorithm to find X in minimal number of throws.  2
implement general tree using link list Wipro1
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.  3
We can draw a box in cprogram by using only one printf();& without using graphic.h header file? NIIT3
what is difference between array of characters and string Accenture10
related to rdbms query .  1
Which of the following about the C comments is incorrect ? a.commentscan go over multiple lines b.comments can start any where in the line c.a line can contain comments with out any language statements d.comments can occur within comments TCS6
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h" Accenture14
What will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }  2
Define function ?Explain about arguments? Geometric-Software2
6)swap(int x,y) { int temp; temp=x; x=y; y=temp; } main() { int x=2;y=3; swap(x,y); } after calling swap ,what are yhe values x&y?  2
How to avoid structure padding in C? Tech-Mahindra4
identify the in correct expression a.a=b=3=4; b.a=b=c=d=0; float a=int b=3.5; d.int a; float b; a=b=3.5; TCS5
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator?? Verifone8
how many error occurs in C language ? Wipro11
write a 'c' program to sum the number of integer values  5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com