whats the difference between int i=5 and int i(5)

Is there any performance difference between above statement.

1
2
3
 int i = 5;

 int i(5);


Does above code contain any kind of difference ?
Please suggest.
Last edited on
Int i = 5 ; here your declaring a variable of type integer and assigning it to 5 , int(5); your declaring a 1 d array of type integer with 6 elements or 6 storage spaces
No. They are both the same.
1
2
int i = 5; // implicit constructor notation 
int i(5); // explicit constructor notation 

BTW this is "articles" section ( the topic was moved )
Last edited on
Topic archived. No new replies allowed.