constructor argument confusion
Hi everyone,
I have a problem regarding class constructors, I know they are not like any other function in some ways and I was wondering if the following is one of them:
Code:
person (int age, float height, string* name)
Why do I send strings and chars as pointers, while int float double etc by value?
and, I have noticed that I manipulate them as pointers not as derefrenced pointers.
as in:
Code:
person (int age, float height, string* name)
{
cout<<name<<endl;
}
while in normal functions
Code:
void swap (int*x, int*y)
{
int temp=*x;
*x=*y;
*y=temp;
cout<<*x<<*y;
}
if any body can tell me whats the deal with that..........Thanks