Split String into String array

前端 未结 6 1838
小蘑菇
小蘑菇 2020-12-31 08:14

I have been playing around with programming for arduino but today i\'ve come across a problem that i can\'t solve with my very limited C knowledge. Here\'s how it goes. I\'m

6条回答
  •  爱一瞬间的悲伤
    2020-12-31 09:03

    For dynamic allocation of memory, you will need to use malloc, ie:

    String returnvalue[splitcount];
    for(int i=0; i< splitcount; i++)
    {
        String returnvalue[i] = malloc(maxsizeofstring * sizeof(char));
    }
    

    You will also need the maximum string length.

提交回复
热议问题