This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

array size



int a[x];

where x=0,1,2,3,.....n;

1.....in CCS compiler "x" should be a fixed length or MACRO.

2.....Is any other possible way to declare array size?

Thanks and Regards,

saitech.

  • Hi Saitech,

    Saitech says said:
    1.....in CCS compiler "x" should be a fixed length or MACRO.


    Irrespective of the compiler, the array size should be fixed through a number or through a MACRO.

    Saitech says said:
    2.....Is any other possible way to declare array size?


    yes, it is possible to declare an array using "malloc" library function, where the size can be a variable which can be get even from the user.


    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    --------------------------------------------------------------------------------------------------------
  • Hi Sai Tech,

    This is a keystone device forum in which we support SoC, Peripherals and MCSDK related queries for development on Keystone devices.

    Please post your compiler related queries to Compiler forum and Code Composer Studio related queries to CCS Forum.

    Please post your general C queries on open source forum.

    Thank you.