Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Is there any difference between dlearations int* x and int
*x? If so tell me the difference?

Answers were Sorted based on User's Feedback



Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / steve

I think there is no difference.
Also,

Case 1:
int* x,y,z;

and

Case2:
int *x,y,z;

these two cases are exactly same.
In both cases, y and z are not pointers. They are int.

Is This Answer Correct ?    32 Yes 4 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / gopinath das

All the above answers are wrong.

There is no difference between int *x and int* x;
Also there is no agreement on waht is the best practice. It
depends on the organizations coding standard.
Even we can write int*x. But this is not a good practice.

Is This Answer Correct ?    31 Yes 4 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / sandy

NO difference

Case 1:
int* x,y,z;

and

Case2:
int *x,y,z;

these two cases are also exactly same.

Is This Answer Correct ?    12 Yes 2 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / sivaraj

There is no difference i verified this with programming....
Do not confuse with other answers....

Is This Answer Correct ?    10 Yes 1 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / uma sankar pradhan

There is no difference between int* x and int *x
Because in C,the number of spaces between two literals
doesnot mean anything.
example,
a+b is same as a + b or a+ b or a +b

Is This Answer Correct ?    11 Yes 3 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / anu

i think there is no difference its correct, both are same

Is This Answer Correct ?    10 Yes 2 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / foo

The difference is that in the first case the space is after
the * and in the second case the space is before.

Functionally there is no difference.

Arguably int* x is slightly worse since (as other answers
demonstrate) people can misinterpret "int* i, j" as
declaring two pointers-to-int where "int *i, j" is perhaps a
bit clearer.

Practically, you should adopt whatever style is required by
wherever you work or whomever you work with.

Is This Answer Correct ?    4 Yes 1 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / praveen verma

I think there is no difference.

There is no difference between int *x and int* x;
Also there is no agreement.

Is This Answer Correct ?    0 Yes 0 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / debendra nath tiwary

there is no difference between them here.
but difference comes how we use them.
(int*) can be used for typecasting.
(int *x) is used for declaration purpose. here x is declared as pointer variable.
even if declare like (int* x) is valid but not a formal way to
to declare pointer variable.

Is This Answer Correct ?    0 Yes 0 No

Is there any difference between dlearations int* x and int *x? If so tell me the difference?..

Answer / subha

can anyone prove me it threough an example

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C++ General Interview Questions

Explain the isa and hasa class relationships. How would you implement each?

0 Answers  


What operator is used to access a struct through a pointer a) >> b) -> c) *

0 Answers  


What is a constructor and how is it called?

0 Answers  


What is function overriding in c++?

0 Answers  


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

0 Answers   Yahoo,


What does iomanip mean in c++?

0 Answers  


What are Virtual Functions? How to implement virtual functions in "C" ?

3 Answers  


What is a loop? What are different types of loops in c++?

0 Answers  


What is "strstream" ?

1 Answers   Huawei,


What is the Standard Template Library?

1 Answers  


What is function overriding?

1 Answers  


What are the manipulators in c++?

0 Answers  


Categories