I've stumbled upon code using the following syntax.
int main(){
class foo{
public:
int x;
foo(int y){x=y;}
}
* bar = new foo(1);
}
Is there any purpose/consequence of using it compared to the more common
int main(){
class foo{
public:
int x;
foo(int y){x=y;}
};
foo * bar = new foo(1);
}
This is probably a matter of opinion but I think the first method is poor coding practice.