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

Answer Posted / reejusri

There is no diffrence between int* x and int *x.
but difference will come into picture when you use:

Case 1:
int* x,y,z;

and

Case2:
int *x,y,z;

in first case x,y and z are integer pointer, where as
un second case only x is integer pointer rest y and z is
integer. So its always a good practice not to put multiple
variable in single line.

Is This Answer Correct ?    4 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of main function in c++?

536


How do you sort a sort function in c++ to sort in descending order?

566


What are the advantages of c++ over c?

598


Write a program in C++ for Fibonacci series

672


Is c++ the best programming language?

548






Explain dangling pointer.

689


What is the difference between the functions memmove() and memcpy()?

642


What is auto used for in c++?

579


Evaluate !(1&&1||1&&0) a) Error b) False c) True

713


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

2545


Can char be a number c++?

608


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

715


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1752


What can c++ be used for?

595


What is nested class in c++?

527