let's see the civil war ;)
Printable View
let's see the civil war ;)
generally, I declare one variable/line, so I declare them like:but if I'm listing on line line,Code:type*var;
and in that line I point out why the other two cases are just wrong.Code:type *var,var,var,*var,var;
for the people that want to get into it (I don't): you're not declaring a type of pointer, you're declaring a pointer to a type. the "var" in your example is the pointer, so it should get the '*'. giving the '*' to the type makes it look like you're trying to say that the type is a pointer to a type, when what you really mean to say is that it's a pointer to a type.
and civil wars aren't civil:yeah, I don't know what that had to do with anything, either.Code:#include<iostream>
int main()
{
int a,*b,**c,***d,****e;
b=&a;
c=&b;
d=&c;
e=&d;
****e=0;
std::cout<<a<<'\n'<<*b<<'\n'<<**c<<'\n'<<***d<<'\n'<<****e<<std::endl;
return 0;
}
This was just done - this is pointless.
http://cboard.cprogramming.com/c-programming/68768-difference-b-w-int%2A-p1-int-%2Ap1.html