About 199,000 results
Open links in new tab
  1. Printing an array in C++? - Stack Overflow

    That array with 3 elements is created dynamically (and that 3 could have been calculated at runtime, too), and a pointer to it which has the size erased from its type is assigned to p. You …

  2. Is there any way to output the actual array in c++

    Jun 22, 2013 · You can write a simple helper function to allow you to stream the array to an output stream (including but not limited to std::cout): #include <iostream> // print an array to an output …

  3. c - How to print the array? - Stack Overflow

    The line (sizeof ( my_array ) / sizeof ( my_array [0] )) will give you the size of the array in question. The sizeof property will return the length in bytes, so one must divide the total size of the array …

  4. c++ - Printing an std::array - Stack Overflow

    Oct 3, 2013 · So, while playing around with std::array, I wanted an easy way to print out all elements of an array, and tried the following: using namespace std; template &lt;class T, int …

  5. How do you print a full array of values in C++ - Stack Overflow

    Nov 13, 2015 · I already know how to print each element of the array using a simple for loop. For example in python, you could simply say x = [], make a for loop to append elements to the …

  6. 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.

  7. c++ - Using cout to print the entire contents of a character array ...

    Oct 15, 2013 · I am quite new to C++ (just a shaky background in Java) and I'm stumped about how to print out the entire contents of a char array. I believe I need to use a loop, and base the …

  8. Printing the hexadecimal representation of a char array []

    (An array expression, in most contexts, is implicitly converted to ("decays" to) a pointer to the array's first element.) If you want to print each element of your array, you'll have to do so …

  9. c++ - Reverse Contents in Array - Stack Overflow

    Your loop only runs for half the length of the array when you divide the count by 2, so it only prints half of the array contents to the screen.

  10. c - Is there a way to have printf () properly print out an array (of ...

    Dec 9, 2011 · I believe I have carefully read the entire printf() documentation but could not find any way to have it print out, say, the elements of a 10-element array of float(s).