Thread: Error: assignment of i_value in read-only object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2020
    Posts
    47

    Error: assignment of i_value in read-only object

    Hello,

    I have two programs that to the best of my knowledge use the same data structures and contain the same statements.

    One program works and the other fails with the error in the title. No doubt there is a reason, but at this stage it is not clear to me.

    Please refer to the two attachments:
    1. Example_Data_Structure
    2. Linked_List_Example


    Example_Data_Structure is a short program that builds and executes as I would expect.

    Example_Data_Structure contains an extract of code from Linked_List_Example.

    For some reason the code works fine in isolation, but not when combined with the other statements.

    It's a mystery to me.

    Linked_List_Example, contains a lot more code (sorry), but also contains the same code as in Example_Data_Structure. I've had to include the whole program because obviously there is something in it which causes the following statement to fail.

    Code:
    record->i_value = 100;
    For reason;
    Code:
    162|error: assignment of member ‘i_value’ in read-only object|
    For some reason I can't upload the other program. No errors but it doesn't appear in the Attachment Manager.

    Also the Attachment Manager states that uploaded programs are supposedly deleted after 1 hour; but my upload from yesterday is still there?
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to read 2 adjacents strings object
    By piero borrelli in forum C++ Programming
    Replies: 3
    Last Post: 09-03-2014, 11:54 AM
  2. int assignment to object incompatibility issue - Java
    By Delicieuxz in forum General Discussions
    Replies: 9
    Last Post: 11-26-2013, 01:58 AM
  3. Replies: 7
    Last Post: 12-07-2012, 10:44 PM
  4. Operator Overloading - RHS object is modified by assignment operation
    By IdioticCreation in forum C++ Programming
    Replies: 16
    Last Post: 12-30-2010, 07:33 AM
  5. assignment of read-only location (vectors)
    By jlangfo5 in forum C++ Programming
    Replies: 4
    Last Post: 12-17-2010, 09:20 AM

Tags for this Thread