Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   List x; and List x();? (http://www.go4expert.com/forums/list-x-list-x-t9310/)

heena.mca 13Mar2008 15:56

List x; and List x();?
 
Is there any difference between List x; and List x();?

asadullah.ansari 13Mar2008 17:08

Re: List x; and List x();?
 
if List is class
then meaning of List x is that x is object of class List.
meaning of List x() is that x is a function which returns a object type List.

ismail.tech21 13Mar2008 18:04

Re: List x; and List x();?
 
you can see the following example
Code:

void f()
 {
  List x;    // Local object named x (of class List)
  ...
 }


Code:


 void g()
 {
  List x();  // Function named x (that returns a List)
  ...
 }



All times are GMT +5.5. The time now is 08:15.