•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 403,318 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,001 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 163 | Replies: 3
![]() |
•
•
Join Date: May 2008
Posts: 16
Reputation:
Rep Power: 1
Solved Threads: 0
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
{
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
You can't assign a whole array, you need to copy it one entry at a time.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
The Right hand value over here in
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
Hope this solves it out.
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
cplusplus Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main() { struct sky{ char a; int b; }; sky art;//Object sky *start; art.a='s'; art.b=9; *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 mart.a=start->a; mart.b=start->b; cout<< mart.a<<"\n\a"<<mart.b<<"\a"; cin.get(); return 0; }
Hope this solves it out.
Websitewiz.co.nr
Check out my Old website. Designed it at the age of 12
Check out my Old website. Designed it at the age of 12
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access activation api blogger blogging blogs code code injection combo dani daniweb data debugging development dreamweaver dropdownlist epilepsy gdata google gpl griefers hackers html innovation intel javascript key linux microsoft module net news openbsd product programming reuse rss serial short selling source tags tech stocks vista web wysiwyg xml
- Need help with 8086 assembly language (Assembly)
- Jni (Java)
Other Threads in the C++ Forum
- Previous Thread: End Of File (ifstream)
- Next Thread: limitation of arrays



Linear Mode