大家好问一下这里的第一个问题,但是我现在从阅读你的回答中得到很多帮助我有一个让我最好的问题。
我有一个简单的程序:
#include <iostream>
#include <ctime>
#include <stdlib.h>
#include "room.h"
#include "area1.h"
using namespace std;
area1::area1()
{
this->description = "You are now in the North-West corner of the island. You have water to the North and the West, and this area is hard to navigate because of all the vegetation. I hope you find something that you need. ";
this->name = "NORTHWEST";
this->odds = 25;
this->random = 100;
this->visited = false;
}
void area1::welcome()
{
cout << name << endl;
cout << description << endl;
}
void area1::treasure()
{
}
void area1::navigate()
{
}
area1::~area1()
{
delete north;
delete east;
delete west;
delete south;
}
我还有一个名为room的ADT基类和一个名为area1的子类。
var totalHotdogs = 525 * 3;
console.log('Total hotdog packs: ' + Math.ceil(totalHotdogs / 10));
console.log('Hotdogs remaining: ' + totalHotdogs % 10);
console.log('Total bun packs: ' + Math.ceil(totalHotdogs / 8));
console.log('Buns remaining: ' + totalHotdogs % 8);
我不明白为什么当我正在做的是从main调用一个简单的函数时,它崩溃了,它调用了我的area1类中的函数。在函数调用的控制台中没有传递任何参数并且输出正确,但它在返回main调用输出之前崩溃了#34;结束&#34; 。我经常做类似的事情没有错误,所以这个让我疯了。任何帮助表示赞赏。