First of all, I tried to search for similar questions, and took a look at the FAQ, but I didn't found anything similar enough.

Here's my problem:

I have got a structure declared as following:

struct pizza
{
char * name;
string tyname;
float diam;
float weight;
};

and the following function, that declares a new struct from the type above.
It uses input to initialize the variables, the important ones are the char array, and the string.
Afterward it returns the new struct.

pizza NewPizza()
{
pizza newpizza;
char name[100];
cout << "What is the company of the pizza? ";
cin.getline(name, 100);
cout << "please enter the type of the pizza: ";
getline(cin, newpizza.tyname);
cout << "Diameter: ";
cin >> newpizza.diam;
cout << "Weight: ";
cin >> newpizza.weight;
newpizza.name = new char[strlen(name)+1];
strcpy(newpizza.name, name);
return newpizza;
}

and my main() looks like that:

int main()
{
pizza * first = &NewPizza();
cout << endl << first->name << "'s- " << first->tyname << ", weights " << first->weight
<< ", and it's size is " << first->diam;
cin.get();
cin.get();
return 0;
}

Well everything seems to work just fine, except that cout doesn't prints first->tyname.
it does prints it when I initialize the struct returns by the function into a new declared struct.
And it does prints it when i try to print it inside the function.
As well, it does prints a pointer to a string when i declare the string inside the function.

Since I'm returning the struct I don't think it got something to do with the scope, nor with the output stream because i tried to clear it before the print of the string.

thanks for your help...