3 Replies - 1532 Views - Last Post: 04 March 2009 - 01:30 AM Rate Topic: -----

#1 sokkerkid13  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 03-March 09

Write to memory

Posted 03 March 2009 - 11:59 PM

&readout[7] = &memcontents[c];
		&readout[15] = &memcontents[d];
		&readout[23] = &memcontents[e];
		&readout[31] = &memcontents[f];




when i try to compile this i get the error:


error: invalid lvalue in assignment, what am i doing wrong?
Is This A Good Question/Topic? 0
  • +

Replies To: Write to memory

#2 bsaunders  Icon User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Write to memory

Posted 04 March 2009 - 12:08 AM

What you're trying to do is assign the addresses of values at different indices in the memcontents array to the addresses of the readout array. You can't assign an memory address to a memory address.
Was This Post Helpful? 0
  • +
  • -

#3 sokkerkid13  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 03-March 09

Re: Write to memory

Posted 04 March 2009 - 12:43 AM

View Postbsaunders, on 3 Mar, 2009 - 11:08 PM, said:

What you're trying to do is assign the addresses of values at different indices in the memcontents array to the addresses of the readout array. You can't assign an memory address to a memory address.


so what exactly should i do to change it?

Was This Post Helpful? 0
  • +
  • -

#4 bsaunders  Icon User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Write to memory

Posted 04 March 2009 - 01:30 AM

readout[7] = memcontents[c];
		readout[15] = memcontents[d];
		readout[23] = memcontents[e];
		readout[31] = memcontents[f];


might work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1