int patientstomemory(patientstruct (*patientstructpointer)[maxpatients])
    patientstruct patientstruct1[maxpatients];
    patientstruct1= (*patientstructpointer);

1>c:\documents and settings\patrick\my documents\hgkbklhb\hgkbklhb\hgkbklhb.cpp(88) : error C2106: '=' : left operand must be l-value

whats wrong? very important, working on semester project due monday

Edited 3 Years Ago by Reverend Jim: Fixed formatting

The Right hand value over here in

patientstruct1= (*patientstructpointer);

Is an error because a the stucture is taking in values from a pointer, which is not allowed.
An example program is written below so that it may help you in solving your problem

#include <iostream>

using namespace std;

int main()
    struct sky{
           char a;
           int b;
        sky art;//Object
        sky *start;
        *start=art;//Pointer is pointing to art which is legal.
        sky mart;
        //*start=mart; // This is illegal in c++ and produces the error.

     //Therefore pass values in this way
        cout<< mart.a<<"\n\a"<<mart.b<<"\a";
        return 0;

Hope this solves it out.

oh may the programming gods bless you
now i know whats wrong ill try to figure out how to do it

This article has been dead for over six months. Start a new discussion instead.