
-----------------------------------
chopficaro
Tue Sep 02, 2008 11:22 am

'read': identifier not found, short code plz help
-----------------------------------
im just trying to get the hang of binary file io by making a simple program that can write a structure into a file, then read it, but the first error message i get is

'read': identifier not found

heres the code:

#include 
#include 
using namespace std;

struct grades
{
int grade1;
int grade2;
int grade3;
int grade4;
} mygradesi,mygradeso;

int main ()
{
int answer;
do
{
coutanswer;
if (answer==2)
{
struct grades * mygradesptri;
mygradesptri=&mygradesi;
ifstream myfilei;
myfilei.open ("binary.bin", ios::in|ios::binary);
if (myfilei.is_open())
{
read(mygradesptri, sizeof(grades));
cout