#include<iostream>
#include<iomanip>
#include<string>



class Pizza{
public:
	std::string type;
	std::string size;
	int toppings;
	
	Pizza(){}

	void setType(std::string type){
	type = type;
}


	std::string getType(){
	return type;
}

	void setSize(std::string size){
	size = size;
}

	std::string getSize(){
	return size;
}

	void outputDescription(){
		//cout<<"A " cout<<getType(); cout<<" pizza;
	}
};

int main(){
	Pizza large = new Pizza();
	large.setType("pan");
        large.setSize("large");


	return 0;

}

In visual studio, I get this error: error C2440: 'initializing' : cannot convert from 'Pizza *' to 'Pizza. What is causing the problem?

You might start by changing line 38 to say

Pizza* large = new Pizza();
large->setType("pan");
large->setSize("large");
delete large;

I did that and now I get an unresolved externals error.

I resolved the externals error. It appears I did something wrong when creating the project. I put the class in a new project and now it works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.