witam
mam projek w dev c++
do projektu mam dodane pliki:
main.cpp
#include<iostream>
#include<conio.h>
#include"main.h"
int main()
{
obiekt ob={napis};
funkcja(ob);
getch();
return 0;
}
oraz
funkcja.cpp
#include<iostream>
#include<conio.h>
#include"main.h"
using namespace std;
void funkcja(obiekt o)
{
cout << o.napis;
}
i poza projektem ale w tym samym katalogu
main.h
typedef struct _obiekt
{
string napis;
}obiekt;
void funkcja(obiekt);
przy kompilacji dostaje:
'string' is used as a type, but is not defined as a type.
[???]
czemu ze stringami się nieda ? i jak temu zaradzić?
próbowałem z typedef string STR; ale to nic niedaje :|