What you are doing is printing the value in the array at spot [3][3], which is invalid for a 3by3 array, you need to loop over all the spots and print them.
for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { printf("%d ", array[i][j]); } printf("\n"); }
This will print it in the following format
10 23 42 1 654 0 40652 22 0
if you want more exact formatting you’ll have to change how the printf is formatted.
Related Posts:
- How do I determine the size of my array in C?
- char *array and char array[]
- How do I create an array of strings in C?
- “Expected expression before ‘ { ‘ token”
- C pointers and arrays: [Warning] assignment makes pointer from integer without a cast
- How do you make an array of structs in C?
- How do I create an array of strings in C?
- Return char[]/string from a function [duplicate]
- Why am I getting “array initializer must be an initializer list or string literal”?
- Using Dynamic Memory allocation for arrays
- Finding the length of a Character Array in C
- Return char[]/string from a function
- How to print a char array in C through printf?
- How to clear all the elements of array in C?
- Zero an array in C code
- Passing an array by reference in C?
- Excess elements in char array initializer error
- I’m getting “Invalid Initializer”, what am I doing wrong?
- Convert char array to string use C
- Iterate through a C array
- What is the difference between char array and char pointer in C?
- Can I create an Array of Char pointers in C?
- The difference between char * and char[] [duplicate]
- GCC: Array type has incomplete element type
- What causes a segmentation fault (core dump) to occur in C?
- uint8_t vs unsigned char
- How to use symbols of extended ASCII table in C?
- What is the difference between ++i and i++?
- Using boolean values in C
- typedef struct vs struct definitions [duplicate]
- Why am I getting “void value not ignored as it ought to be”?
- 1 = false and 0 = true?
- Convert char to int in C and C++
- Get a substring of a char*
- What causes the Broken Pipe Error?
- Strings and character with printf
- How do I declare a 2d array in C++ using new?
- Why does the terminal show “^[[A” “^[[B” “^[[C” “^[[D” when pressing the arrow keys in Ubuntu?
- Why is the gets function so dangerous that it should not be used?
- Write to .txt file?
- How do I declare a 2d array in C++ using new?
- What does “collect2: error: ld returned 1 exit status” mean?
- Warning comparison between pointer and integer
- Using ssize_t vs int
- Why a warning of “control reaches end of non-void function” for the main function?
- How do I use extern to share variables between source files?
- Cannot assign requested address – possible causes?
- error: called object is not a function or function pointer
- munmap_chunk(): invalid pointer
- C read file line by line
- Get the current time in C
- where does stdio.o live in linux machine?
- Get text from user input using C
- How do I lowercase a string in C?
- warning: expression result unused
- conflicting types error when compiling c program using gcc
- Get the current time in C
- What is a file with extension .a?
- error: indirection requires pointer operand (‘int’ invalid)
- Understanding NumPy’s einsum
- Valgrind: Invalid read of size 1
- Encrypt with private key and decrypt with public key
- 2D array vs array of arrays
- How to create an array of strings in C?
- strcmp giving segmentation fault
- What does “pointer being freed was not allocated” mean exactly?
- Initialization from incompatible pointer type warning when assigning to a pointer
- How to use timer in C?
- Java Comparator class to sort arrays
- Convert char array to a int number in C
- What is the difference between stdin and STDIN_FILENO?
- PHP multidimensional array search by value
- Allocating string with malloc
- How to simply convert a float to a string in c?
- How to copy a char array in C?
- hash function for string
- What happens during a “relocation has invalid symbol index” error?
- Initializing array of structures
- Multi-dimensional arrays in Bash
- What is the difference between array and enum in C ?
- Double pointer array in c++
- Error: “Access not within mapped region at address” (Valgrind)
- printf format specifiers for uint32_t and size_t
- Create a two dimensional string array anArray[2][2]
- How to convert string to float?
- What is an simple example of copy_from_user
- C char array initialization
- How to Sort a Multi-dimensional Array by Value
- What is `S_ISREG()`, and what does it do?
- typedef struct pointer definition
- How does the fscanf function work?
- Math constant PI value in C
- How to sort 2 dimensional array by column value?
- char array not assignable
- Warning: comparison of distinct pointer types
- getline() vs. fgets(): Control memory allocation
- Segmentation fault- strcat
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- Initializing 2D char array in C
- Multidimensional Arrays lengths in Java