Welcome Guest.

4Answers

Open a 100000 array, the number of character data can exceed 100000

Asked by: Richard 193 views IT December 3, 2018

Open a 100000 array, the number of character data can exceed 100000

4 Answers

  1. +7Votes  

    Change depends on the language you use. The subscripts of C/C++/JAVA/C# are all starting from 0. Your array is available

    0~99999, 100000 available, but generally The string will be followed by ‘\0’ as the terminator, so there should be one less

    you can only use the array as 100000, and when used as a string, you can only use 99999

    Martha- December 4, 2018 |

  2. +3Votes  

    can be implemented by the following statement:
    char *p; //Define pointer variable
    p = (char *)malloc(100000);//Apply space and assign value Give p.
    Parsing:
    malloc is a memory allocation function, which is defined as
    void * malloc(size_t size);
    The function is to apply the size of the memory size and return the assigned address value.
    And the character type, each element occupies 1 byte space, so the total space of 100000 variables is 100000 bytes, so the parameter size is 100000.

    Laura Evans- December 4, 2018 |

  3. +4Votes  

    can be implemented by the following statement: char *p; //Define the pointer variable p = (char *)malloc(100000);//Apply space and assign it to p. Parsing: malloc is a memory allocation function defined as void * malloc(size_t size); the function is to apply the size of the memory size and return the assigned address value. The character type, each element occupies 1 byte space, so the total space of 100000 variables is 100000 bytes, so the parameter size is 100000.

    Diane Morris- December 4, 2018 |

  4. +4Votes  

    Look at the array type you define, if it is int, lint, folat, etc.

    Carolyn- December 4, 2018 |