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

  • Home
  • SEARCH
  • 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 8122183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:44:47+00:00 2026-06-06T05:44:47+00:00

I am very beginner in C. I have the following structure typedef struct {

  • 0

I am very beginner in C. I have the following structure

typedef struct
{
    zuint8                      u8ZCLVersion;

 #ifdef CLD_BAS_ATTR_LOCATION_DESCRIPTION
    tsZCL_CharacterString       sLocationDescription;
    uint8                       au8LocationDescription[16];
 #endif

 #ifdef CLD_BAS_ATTR_PHYSICAL_ENVIRONMENT
    zenum8                      u8PhysicalEnvironment;
 #endif

 #ifdef CLD_BAS_ATTR_DEVICE_ENABLED
    zbool                       bDeviceEnabled;
 #endif
} tsCLD_Basic;

now i want to set au8LocationDescription[16] field. And I am using this piece of code.

tsCLD_Basic sCombined;
sCombined.au8LocationDescription[16] = {0x42,0x65,0x64,0x20,0x52,0x6f,0x6f,0x6d};

but its shows error
error: expected expression before ‘{‘ token

how could I write the values..???

  • 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-06-06T05:44:50+00:00Added an answer on June 6, 2026 at 5:44 am

    As the comment of Als says, what you are trying to do is not possible. You will need to assign each array element separately like this

        sCombined.au8LocationDescription[0] = 0x42;
        sCombined.au8LocationDescription[1] = 0x65;
        ...
    

    and so on until each element is has the value you want.

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

Sidebar

Related Questions

Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
I am very much a beginner to rails and I have a specific need
I'm very new to Objective-C, and am having some beginner issues. I have an
I am only a very beginner user of git and have a C# Visual
I'm a beginner at XSL FO. I have a very simple XML document :
I am a very new beginner and have been reading the help forums. All
Ok so this is probably a very beginner question but... Right now I have
I'm very beginner for developping. environment is .. Windows XP Professional SP3 Microsoft Visual
being a beginner i m trying to develop a very simple service using express
Very frustrating problem I have here. I have this code: Button b = findViewById(android.R.id.button1);

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.