About 187,000 results
Open links in new tab
  1. c++ - How do I find the length of an array? - Stack Overflow

    Is there a way to find how many values an array has? Detecting whether or not I've reached the end of an array would also work.

  2. c++ - How to get the real and total length of char * (char array ...

    Jan 9, 2014 · This can lead to some problems when the char array contains binary informations (image pointer for instance) : the array can contains '\0' bytes in the data and in this case, the …

  3. C++ - GetLength() method to get length of an array - Stack …

    Dec 31, 2015 · It's because array has decayed to a pointer type when it's passed to getLength. So in that function, sizeof cannot be used to retrieve the total size of the array; it merely evaluates …

  4. length of array in c++ - Stack Overflow

    Dec 28, 2009 · The information about array size is lost right away and trying to use the sizeof method with such a pointer will not work. In order to preserve the size information about a …

  5. c++ - How to reliably get size of C-style array? - Stack Overflow

    Some other info: for C++, instead of passing a raw array pointer, you might want to have the parameter use something that wraps the array in a class template that keeps track of the array …

  6. getting size of array from pointer c++ - Stack Overflow

    C++ is based on C and inherits many features from it. In relation to this question, it inherits something called "array/pointer equivalence" which is a rule that allows an array to decay to a …

  7. how to find 2d array size in c++ - Stack Overflow

    Apr 23, 2012 · Accessing an array element using an invalid index: If you use std::vector, you can use vector::at function instead of [] operator to get the value, if the index is invalid, an …

  8. Finding the size of an array of strings in C++ - Stack Overflow

    The first is to add a special “last” element of the array so that application can traverse the array until it sees the last element and calculate the array’s length. String literals are the perfect …

  9. c++ - Size of static array - Stack Overflow

    Jan 17, 2009 · I declare a static char array, then I pass it to a function. How to get the no. of bytes in the array inside the function?

  10. c - Get length of an Array using a pointer - Stack Overflow

    Is there a way to get the length of an Array when I only know a pointer pointing to the Array? Technically yes, there is a way when code has a true pointer to an array as the array size is in …