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 8959285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:24:00+00:00 2026-06-15T15:24:00+00:00

Why isn’t it in C (or C++) allowed? I mean this: ucell GetPlayerPosPositionData[5]; GetPlayerPosPositionData

  • 0

Why isn’t it in C (or C++) allowed?

I mean this:

ucell GetPlayerPosPositionData[5];
GetPlayerPosPositionData = {4*sizeof(cell),playerid,0,sizeof(cell),2*sizeof(cell)};//this does not work, error

//normal assignment
GetPlayerPosPositionData[1] = playerid;
GetPlayerPosPositionData[2] = 0;
GetPlayerPosPositionData[3] = sizeof(cell);
GetPlayerPosPositionData[4] = 2*sizeof(cell);
  • 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-15T15:24:00+00:00Added an answer on June 15, 2026 at 3:24 pm

    Because the syntax says it is not allowed? There are two parts to the problem:

    1. You can’t use the initializer syntax except in an initializer or (in C99) in a compound literal.

    2. You can’t assign whole arrays.

    In C99, you could pass an array to a function:

    typedef unsigned int cell;
    
    extern void some_func(cell data[]);
    
    extern void func(void);
    
    void func(void)
    {
        cell playerid = 0;
        some_func((cell[]){4*sizeof(cell),playerid,0,sizeof(cell),2*sizeof(cell)});
    }
    

    (Your question is unclear on cell vs ucell; I chose to use cell throughout.)

    You still can’t do array assignment. If the array is wrapped in a structure, you can do the structure assignment which, coincidentally, assigns the contained array. But that is a structure assignment, not an array assignment.

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

Sidebar

Related Questions

Isn't JavaScript enabled in all webbrowsers by default? if yes, does this mean that
Isn't this / ? Why is there a constant for it? It's not like
This isn't so much a programming issue, but i'm not sure where else to
Isn't HTML5 is supposed to work in IE9? It’s not working as expected for
Isn't visual studio supposed to automatically generate this file for each webservice creation ?
Isn't Makefile syntax is target: require_files cmd... Why I got this problem? Makefile MXMLC
Isn't this a simpler as well as safe (and hence better) way to implement
Isn't there a better way to accomplish this?: (RegionID is a Flex ComboBox) RegionID.selectedItem=value.Region;
This isn't working the way I expect it to. Sample input will include an
Isn't this a client side control? What will happen if the user has disabled

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.