This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

array for realview compiler

I want to use two dimensional array on realview compiler with type A[n][10] where n is an variable of type unsigned char. but it show an error.

Parents
  • The dynamic memory allocation just allocates memory - it neither knows nor cares how you're going to use that memory.

    So just look-up "dynamic memory allocation" in the Realview compiler Manual...

    Before talking abou Realview specifics, you do know how to do this in plain, ANSI 'C', don't you...?

Reply
  • The dynamic memory allocation just allocates memory - it neither knows nor cares how you're going to use that memory.

    So just look-up "dynamic memory allocation" in the Realview compiler Manual...

    Before talking abou Realview specifics, you do know how to do this in plain, ANSI 'C', don't you...?

Children
  • Note that dynamic memory allocation is often best avoided in embedded systems.

    What, exactly, are you trying to achieve here?

    If you explain what you're actually trying to achieve, people may be able to offer better approaches - rather than just discuss a potentially broken approach...

  • at the time of compilation , i do not know the size of multidimensional array that's why i want to know about dynamic memory allocation for two dimensional array in realview compiler

  • "at the time of compilation , i do not know the size of multidimensional array that's why i want to know about dynamic memory allocation for two dimensional array in realview compiler"

    You were asked to explain what you are actually trying to achieve.
    Using a 2D array of unknown size may or may not be a good way to do what you need - but nobody can comment on that without knowing what, exactly, you are actually trying to do!