#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
struct oddaja
{
char ime[30];
char tip[30];
char datum[30];
int gledanost;
int trajanje;
oddaja * naslednji;
};
oddaja *vozlisce=NULL;
void vpis(oddaja *vozlisce, int& stodd)
{
// oddaja * vmesnik;
int n;
system("cls"
cout << "Koliko oddaj zelis vpisati?: ";
cin >> n;
for(int i=0; i<n ; i++)
{
oddaja * vmesnik;
vmesnik=new oddaja;
system("cls"
cout << "Vpisi ime " << i+1 << ". oddaje: " << endl;
cin >> vmesnik -> oddaje[stodd].ime;
stodd++;
vmesnik -> naslednji=vozlisce;
vozlisce=vmesnik;
}
}
void main()
{
oddaja oddaje[30];
vpis(vozlisce,stodd); break;
}
//////////////////////////////////
The program produces this error:
error C2039: 'oddaje' : is not a member of 'oddaja'
see declaration of 'oddaja'
error C2228: left of '.ime' must have class/struct/union type
Please help, what am i doing wrong?
#include <stdlib.h>
#include <iostream.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
struct oddaja
{
char ime[30];
char tip[30];
char datum[30];
int gledanost;
int trajanje;
oddaja * naslednji;
};
oddaja *vozlisce=NULL;
void vpis(oddaja *vozlisce, int& stodd)
{
// oddaja * vmesnik;
int n;
system("cls"
cout << "Koliko oddaj zelis vpisati?: ";
cin >> n;
for(int i=0; i<n ; i++)
{
oddaja * vmesnik;
vmesnik=new oddaja;
system("cls"
cout << "Vpisi ime " << i+1 << ". oddaje: " << endl;
cin >> vmesnik -> oddaje[stodd].ime;
stodd++;
vmesnik -> naslednji=vozlisce;
vozlisce=vmesnik;
}
}
void main()
{
oddaja oddaje[30];
vpis(vozlisce,stodd); break;
}
//////////////////////////////////
The program produces this error:
error C2039: 'oddaje' : is not a member of 'oddaja'
see declaration of 'oddaja'
error C2228: left of '.ime' must have class/struct/union type
Please help, what am i doing wrong?