About 106,000 results
Open links in new tab
  1. How do I work with dynamic multi-dimensional arrays in C?

    May 28, 2009 · Does someone know how I can use dynamically allocated multi-dimensional arrays using C? Is that possible?

  2. How to dynamically allocate arrays in C++ - Stack Overflow

    Feb 21, 2016 · I know how to dynamically allocate space for an array in C. It can be done as follows: L = (int*)malloc(mid*sizeof(int)); and the memory can be released by: free(L); How do I …

  3. How to include a dynamic array INSIDE a struct in C?

    Structs with flexible array members at the end can only be allocated dynamically in C. Your assumption about pointer aritmetics being faster then arrays is absolutely incorrect. Arrays …

  4. How to dynamically allocate an array of integers in C

    Nov 7, 2016 · Then the array out is sent with function alpha. Right now the function alpha always sends out [10] since b has been declared as 10 in second line of code. How can I allocate …

  5. Initializing C dynamic arrays - Stack Overflow

    Jul 30, 2013 · Because each location of the array stores an integer therefore we need to pass the total number of bytes as this parameter. Also if you want to clear the array to zeros, then you …

  6. c - Using Dynamic Memory allocation for arrays - Stack Overflow

    Apr 1, 2015 · How am I supposed to use dynamic memory allocations for arrays? For example here is the following array in which i read individual words from a .txt file and save them word …

  7. append to dynamically allocated array in c - Stack Overflow

    Nov 1, 2010 · 1 sizeof returns the size of the type, in this case the size of an int * which I assume is 4 bytes. So you are making the array size 5, but you are setting element (4 - 1) to 23. You'll …

  8. How do I dynamically allocate an array of strings in C?

    Oct 4, 2011 · If I have the number of items in a var called "totalstrings" and a var called "string size" that is the string size of each item, how do I dynamically allocate an array called "array?" …

  9. c - dynamic allocation of array of pointers - Stack Overflow

    Sep 25, 2012 · If that value is a valid pointer, within the memory your program had allocated, it will not die with Segmentation Fault. You may be writing into other data though. 2. If the value is …

  10. c - How can I create a dynamically sized array of structs ... - Stack ...

    I know how to create an array of structs but with a predefined size. However is there a way to create a dynamic array of structs such that the array could get bigger? For example: typedef str...