I was analyzing this question made in SOEN. There you are teaching to instantiate a particular class.
I was able to understand more or less how it works, because when I use my example, it is giving error when compiling.
class Pessoa {
int idade;
float tamanho;
};
int main()
{
Pessoa pessoa = new Pessoa();
}
However, the following error appears:
error: conversion from 'Person *' to non-scalar type 'Person' requested Person person = new Person ();
The error is resolved when I place an asterisk in front of the word Pessoa
.
Pessoa* pessoa = new Pessoa ();
So, what is the function of the asterisk in this case? What does it indicate?