#include <iostream>
#include <string>
using namespace std;
#pragma hdrstop
#pragma argsused
//---------------------------------------------------------------------------
class Katalog
{
int i,sz;
int* name_book;
int* name_autor;
int* summ_books;
public:
Katalog()
{
i = 0;
sz = 10000;
name_book = new int[sz];
name_autor = new int[sz];
summ_books = new int[sz];
}
void Katalog::new_book()
{
cout << "Enter new book data:" << endl;
std::cin>>name_book[i];
std::cin>>name_autor[i];
std::cin>>summ_books[i];
++i;
}
void Katalog::console_books()
{
for(int b=0; b<i;b++)
{
std::cout<<"Êíèãà: "<<name_book[b]<<" Àâòîð: "<<name_autor[b]<<" Êîëè÷åñòâî ýêçåìïëÿðîâ:"<<summ_books[b] << endl;
}
}
};
int main(int argc, char* argv[])
{
Katalog* kat = new Katalog();
string input;
cout << "New command?" << endl;
cin >> input;
while ( input != "exit") {
if(input=="Help")
{
cout << "Simple help message." << endl;
}
else if(input=="New")
{
kat-> new_book();
}
else if(input=="Window")
{
kat->console_books();
}
else
{
std::cout<<"Error: " << input << " unrecognized!" << endl;
}
cout << "New command?" << endl;
cin >> input;
}
}
Hello, Vamp!
V> V> class Katalog
V> {
V> int* name_book;
V> int* name_autor;
V> int main(int argc, char* argv[])
V> {
V> Katalog* kat = new Katalog();
V> }
V>
ура! почти все ошибки исправили

осталось только не забыть каталог удалить (и зачем его указателем сделали? ). ну еще name_book и name_author почему то стали int хотя сначало было string, но это уже мелочи.
Posted via RSDN NNTP Server 1.9