Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6151003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:42:18+00:00 2026-05-23T19:42:18+00:00

I am trying to solve this error, but failed miserably. I have declared my

  • 0

I am trying to solve this error, but failed miserably. I have declared my code below

msc_con_list_slot msc_slot;
memset(&msc_slot, 0, sizeof(msc_slot));
msc_pdn_con_t*conn = &msc_slot.conn;

msc_ber_list_slot bearer_slot;
memset(&bearer_slot, 0, sizeof(bearer_slot));
msc_ber_t *bearer = &bearer_slot.bearer;

and tried to iterate it

for(&bearer_slot=(&(conn->bearers))->head; &bearer_slot; &bearer_slot=(&bearer_slot)->next)
{
//asign value here 
}

I got an error of :
lvalue required as left operand of assignment
warning: the address of ‘bearer_slot’ will always evaluate as ‘true’

Maybe I miss something, because I don’t really get what is the error actually mean is. Thank you for your help

edit add struct:

typedef struct {
        int id;
} msc_ber_t;

typedef struct _msc_ber_list_slot {
        msc_ber_t bearer;
        struct _msc_ber_list_slot *next, *prev;
} msc_ber_list_slot;

typedef struct {
        msc_ber_list_slot *head, *tail;
} msc_ber_list;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:42:20+00:00Added an answer on May 23, 2026 at 7:42 pm

    In the for loop, you are assigning values to &bearer_slot, that is, the address of the variable bearer_slot, which is not allowed (it is not an lvalue) and makes no sense. Furthermore, your loop condition is the value of &bearer_slot, which will always evaluate to true (as it is a non-NULL pointer), so your loop will run forever. You will need to provide more context on what you want this loop to do. By the way, (&x)->y can be written more succinctly as x.y – this would make your code a lot more readable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to solve this problem for a while, but couldn't with
I'm trying to solve a segmentation fault. This message appears in my apache-error.log: [notice]
I am trying to solve this problem. I have a series of SELECT statements
I've been trying to solve this problem for a number of days now but
I'm trying to solve this problem, its not a homework question, its just code
I'm trying to push my code into github, but almost everytime I meet this
Trying to solve this problem . I would like to learn how the bootstrapper
I'm trying to solve this flickering problem on the iphone (open gl es game).
I've been trying to solve this for ages (3 days) now and I just
I've been trying to solve this issue for a long time, and nothing seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.