I am new to C++ I recently been trying to write an Game data base in C++ but I succesed in nothing though the Code seem to be all right it always shows me error messages
this is the Source Code i created for this program:
#include<iostream.h>
#include<conio.h>
#define max 1000
//------------------------------------------------------------------------------
struct moto{
char gra[10];
rodzaj[10];
int rok_produkcji;
};
moto game[max];
void main()
{
clscr();
cout<<"Podaj liczbę Gier których dane chcesz wprowadzic:\n";(from Polish Users message:How many Games you wish to type in ?)
int n;
cin>>n;
for(int i=0; i<n;++)
{
cout<<"\n\n Podaj nazwe ",, i+1<<"gry:"; (Users Message: Please write the title)
cin>>game[i].gra;
cout<<"\n podaj rodzaj"<<i+1<<"gry:"; (Users Message Type of game)
cin>>game[i].rodzaj;
cout<<"\n podaj rok produkcji" <<i+1<<"gry:"; (Users message: Publication Year)
cin>>game[i].rok_produkcji;
}
cout<<"\n\n wybierz opcje:\n";(Users Message Please pick an option)
cout<<"1. szukanie wedlug nazwy gry:\n";(Searching by Name )
cout<<"2.Szukanie wedlug daty produkcji:\n";(searching by date)
int opcja
cin>>opcja;
switch(opcja)
{
case 1:cout<<"Podaj nazwe gry:\n"; (write name of the game)
char name[10];
cin>>name;
clscr()
for(i=0;<n;i++)
if(stremp(name,game[i].gra)==0)
cout<< "n\n" <<game [i].gra<<""<<
game[i].rodzaj
<<"\n rok produkcji"<<game[i].rok_produkcji;
break
case 2:cout <<"podaj rok produkcji gier:\n"; (Type in Year of Publication)
int rok;
cin>>rok;
clscr();
for (i=0; i<n;i++)
if(rok==game[i].rok_produkcji)
cout<<"n\n" << game[i].gra<<game[i] <<
rok_produkcji;
break
default:cout<<"Podaj numer 1 lub 2"; (Choose 1 or 2)*
}
getch();
}
Evrytime I start the compilator it shows me this error messages:
[C++ error]Unit1.cpp(9)Type name expected
-II- Unit1.cpp(15)Call to undefined function 'clscr'
Unit1.cpp(19)Expresion Syntax
Unit1.cpp(28)For statement missing
Unit1.cpp(32)Declaration Syntax error
Unit1.cpp(39)Statement missing
Unit1.cpp(39)Expresion syntax
Unit1.cpp(39)Statement missing
Unit1.cpp(46)Break Statement missing
Unit1.cpp(53)Undefined symbol rok_produkcji (It is there so why it dosent se it?)
Unit1.cpp(56) Break statement missing
* Note: Translation werent in the original code I placed them assuming you Dont know Polish (im from Poland)
Basically Thats was my Idea but I made some mistake could you write me a Gamedatabase based on this idea or just rewrite my Source code so It will compile and start working ........Also What does error mean coul you please take a time and explain it to me I am an amateur and I just dont get it what that Compilator wants Im working on (C++Builder 6 from Borland) I thought that the Source code was right PLEASE ANSWER ME !!!!!