Pointer to array in c. A two-dimensional (2D) array is an array of arrays.
Pointer to array in c One of the main applications of the array of pointers is to store multiple strings as an array of pointers to characters. It is a simple and fast way of storing multiple values under a single name. g. The a+i expression is the pointer arithmetic equivalent of &a[i], which is also a valid expression to pass to scanf. See strncat for example. 1 Array subscripting. You ca use the array indexing to access each variable in that array. Use the data type then an asterisk sign followed by an identifier (array of pointers variable name) with a subscript ([]) containing the size of the array. new gives you a pointer back to that array. An lvalue or rvalue of type “array of N T” or “array of unknown bound of T” can be converted to an rvalue of type “pointer to T. Nov 24, 2016 · +1, As a slight extension to the last line, in C++ you can also pass the array by reference, and you can use templates to make the code independent of the array sizes: template <std::size_t N, std::size_t M> void process( double (&a)[N][M] ); if you want it to be able to work with different sizes. A pointer is a variable whose contents is an address of some location in memory. The width of each cell, in bytes, depends on the "type" of the pointer. For example, if we have to store the marks of 4 or 5 students then we can easily store them by creating 5 different variables but what if we want to store marks of 100 students or say 500 students then it becomes very challenging to create that numbers of variable Jul 5, 2024 · The interaction of pointers and arrays can be confusing but here are two fundamental statements about it: A variable declared as an array of some type acts as a pointer to that type. I only learnt about array pointers a short while ago, and they don't seem very common, so it's an easy bit of syntax to miss. Pointers are variables that store the address of data variables. Jan 9, 2015 · says your array is called array. Dec 28, 2018 · Then, since &arr[0] is a pointer to an array of 4 char, x must also be a pointer to an array of 4 char (or something compatible, perhaps a pointer to an array of an unknown number of char). , array++ miserably fails). the pointee, but of course that didn't retroactively affect the design of C. ptr + 1 *ptr + 1; ptr is a pointer to an entire array. Please keep in mind, this is only an example, it has some short commings like difficulty of sorting or inserting a node in the middle, but Feb 7, 2017 · Absolutely: if a is an int* or an array int a[10], and i is between 0 and 9, this expression is valid. May 25, 2011 · int* array_pointer = array; which is the same as: int* array_pointer = &array[0]; and this allows to access array elements in the usual way: array_pointer[3], but you cannot treat array as a pointer, like doing pointer arithmetics on it (i. You can then use pointers' math to do some magic This will point to the Oct 27, 2017 · In C programming, pointers and array shares a very close relationship. That is, it is a pointer, and, at the memory it points to, there must be another pointer. Two std::array template instantiations with different sizes are different types. So you cannot have a pointer that can point to arrays of different sizes (barring void* trickery, which opens its own can of worms. Let us look at what happens when we write int myArray[5];. * array[n] says you have a pointer to an array. Otherwise copying the pointers to strings is incorrect. 1-D Arrays. The print function takes an int* (or a decayed array) anyway. int * array[n]; says you have a pointer to an integer array called 'array' of size n. Oct 11, 2024 · Pointers in C are variables that are used to store the memory address of another variable. Jul 5, 2009 · a reference to var has type pointer to int (Link to C Faq Relevant's section). A 2D array is actually passed as a pointer to its first row. When using double pointers to create 2D arrays, you're actually creating an pointer that points to an array of pointers, with the pointers within the array pointing to strings/values stored in each row. Working of C++ Pointers with Arrays. In fact that's usually what you want to do. For example, if we have an array named val, then val and &val[0] can be used interchangeably. Usually a pointer-to-array is passed only when you want to pass a 2d array, where it suddenly looks a lot clearer, as below. *ptr is a pointer to the first element of the array. A pointer that points to the 0th element of an array and a pointer that points to the whole array are totally different. char array[20]; for a pointer to char, you don't need an array. myMax also expects the number of elements in the array as an int. An array in C is a homogenous collection of elements of a single data type stored in a continuous block of memory. A reference to &var is a pointer to an array of 10 ints. A pointer in C is a variable that stores the memory address of another variable, but when it comes to pointers to arrays, the scope broadens significantly, allowing us to manipulate entire arrays with remarkable efficiency. Apr 9, 2014 · In C/C++ the name of an array is a pointer to the first element of the array. Any changes to b will cause changes to a since they both wind up pointing to the same block of memory. In that case: Jan 4, 2016 · To verify (please bear with me, I'm a newbie =] ), if you wanted a dynamic array of pointers to char (e. If you turn compiler diagnostics up to -pedantic level you should see warnings. Declaration of 3D Array in C However, for backward compatibility reasons the behavior of B/BCPL arrays was preserved (emulated) as much as possible at superficial level: the new C array readily decayed to a temporary pointer value, pointing to the beginning of the array. For example, a value of type int (*)[5] can be used to initialize a variable of type const int (*)[5]. So, you can FORCE C to check for type safety on an array by passing explicit pointers to arrays, like this: Jan 10, 2025 · We also need to pass these sizes of rows and columns of the array because an array is always passed as pointers. Feb 7, 2024 · data_type *pointer_name ; Pointers to an Array in C++. pointer = array; to part of the array (assuming no 'funny' business with the NUL terminator) pointer = &array[10]; Sep 5, 2012 · However, both of these are 'starting from here' solutions. Jun 28, 2024 · In C, arrays are data structures that store data in contiguous memory locations. We can use an array of pointers to store the addresses of multiple elements. A[i]. 1. It returns a pointer to the first element of an array. Sep 5, 2010 · That is, you have created a one-element array, where the element-type of that is a 7-element array of int. The simplest way to get that is to allow the array name to decay to a pointer, thus mkvCopyWord(a, 10). // Declare test_array_ptr as pointer to test_array test_array *test_array_ptr = &array_t1; (*test_array_ptr)[0] = new_struct; The cdecl utility is useful for deciphering complex C declarations, especially when arrays and function pointers get involved. Then copy the value of that pointer into the array of pointers. Array of Pointers to Strings in C++A pointer to a string Semantically, the pointer dereference says "Here's a thing, but I really care about the thing X spaces over", while the array access says "Here's a bunch of things, I care about the Xth one. Pointer to Array Basics in C. C Pointers Appl Dec 12, 2014 · The answer for the last two can also be deducted from the golden rule in C: Declaration follows use. It is not a pointer to a pointer. Once you declare an array: int a[10]; there is no way of overwriting it, only of changing the values it contains. In general it's much nicer to use typedefs for these complicated types, as dirkgently suggests. The difference is that when accessing x[0], in the first case, the content of the Array (or the value the pointer points to) may change outside the current program flow. The rest of the array functionality remained unchanged, relying on that readily available result of the decay. Each pointer type lays downs a row with differing cell widths. In GNU C, pointers to arrays with qualifiers work similar to pointers to other qualified types. Oct 15, 2011 · Arrays are not assignable in C++. If your type T is a pointer itself, it's exactly the same : you write new double*[size];, and you get an array of pointers. This is because the pointer itself does not carry information about the size of the array it is pointing to. It is also referred to as a pointer-to-pointer. In this article, we will learn how to store the array of pointers to strings in C++. The value of this pointer constant is the address of the first element. 1-4 Apr 15, 2013 · Note that it points at the whole array, not a single element of it. Prerequisite: Pointers in C. For example: Apr 10, 2014 · In your 'p' method, you're assigning pointer b to be pointer a, or, in otherwords, you're making b point to what a points to. Jan 17, 2017 · To take a closer look, understand the nature of the declaration: int *array[10]; This declares an array of 10 pointers (currently uninitialized) to ints -- note that this is not the same as a pointer to an array of 10 ints, which would instead be declared int (*array)[10]. In a three-dimensional array, we use three subscripts to access elements, where the first represents the depth, the second represents the row, and the third represents the column. If we have a pointer, we can actually change the value of the pointer to point to another place in the array. Jan 4, 2017 · This is a pointer to an array. Arrays and pointers are different. So, if we move *ptr by 1 position it will point the second element. Dec 7, 2012 · You want to modify the value of an int* (your array) so need to pass a pointer to it into your increase function: void increase(int** data) { *data = realloc(*data, 5 * sizeof int); } Calling code would then look like: May 1, 2009 · A rule of thumb for decoding C/C++ types is "starting from the variable name, read right when you can and left when you hit a closing parenthesis. The expression *p[i] is treated as *(p[i]) due to operator precedence (which is equivalent to *(*(p + i))). See examples of how to print, change and loop through array elements with pointers. In your case, BTreeNode* is a pointer to BTreeNode, and BTreeNode** is a pointer to BTreeNode* which is a pointer to BTreeNode. See examples of pointer to array, pointer to multidimensional array, pointer to character string and array of pointers. When an array expression appears as an operand to the & operator, the type of the resulting expression is "pointer to N-element array of T", or T (*)[N], which is different from an array of pointers (T *[N]) and a pointer to the base type (T *). Oct 11, 2008 · Is it possible to initialize an array of pointers to structs? Something like: struct country_t *countries[] = { {"United States of America", "America"}, {"England Aug 18, 2018 · Think of "pointer types" in C and C++ as laying down a very long, logical row of cells superimposed on the bytes in the memory space of the CPU, starting at byte 0. Learn how to use array names as constant pointers and access array elements using pointers in C. Pointers allow us to efficiently manage the memory and hence optimize our program. Access Array Using Pointer to an Array. 2. 1 Lvalues, arrays, and function designators 3 Except when it is the operand of the sizeof operator or the unary & operator, or is a string literal used to initialize an array, an expression that has type ‘‘array of type’’ is converted to an expression with type ‘‘pointer to type’’ that points to the initial element of Jun 10, 2024 · In C++, an array is a data structure that is used to store multiple values of similar data types in a contiguous memory location. Sadly, it doesn't fix sizeof() and compilers don't seem to use that information yet, so it remains a curiosity. – Feb 2, 2024 · Use int* var Notation to Pass the Array Argument to Function and Then Return in C++. 66% off Learn to code solving problems and writing code with our hands-on C Programming course. The most widely used notation for this is p[n], where n is the n+1th character [element]. In this article, we will study the different aspects of array in C language such as array declaration, definition, initialization, types of arrays, array syntax, advantages and disadvantages, and many more. Your declaration int (*ptr) [10] rightly creates a pointer to an array of 10 ints to which you assign &var (the address of a pointer to an array of 10 ints) (Link to C Faq Relevant's section). 2. Jun 23, 2022 · In C++, an array is a homogeneous collection of data that is stored in a contiguous memory location. Three-Dimensional (3D) Array in C. Mar 19, 2012 · Here's a pointer to an array of chars (I assumed a 10-element array): char (*x)[10]; Let's break it down from the basics: x is a pointer: *x to an array: (*x)[10] of chars: char (*x)[10] However, most of the time you don't really want a pointer to an array, you want a pointer to the first element of an array. Aug 21, 2024 · 2. When used by itself, it points to the first element of the array. A pointer can be indexed like an array name. Jan 5, 2014 · In C, when an array identifier appears in a context other than as an operand to either & or sizeof, the type of the identifier is implicitly converted from "N-element array of T" to "pointer to T", and its value is implicitly set to the address of the first element in the array (which is the same as the address of the array itself). An array has an address, but an array is not an address. Your code (which looks ok) doesn't return a pointer to an array. int* pc, c; Here, a pointer pc and a normal variable c, both of type int, is created. A Three-Dimensional Array or 3D array in C is a collection of two-dimensional arrays. Pointers to arrays are certainly a part of C, but they are at the outer edges of C and you should generally assume that if your design calls for their use, then your design is probably not the best. p = ArrayOfIntegers; // p points to the first element of ArrayOfIntegers ARRAY OF POINTERS Learn how to use pointers to access and manipulate arrays in C. A short example using an array of pointers, assigning a pointer to There is also a close association between the two. Sep 17, 2024 · Learn how to use pointers to access and manipulate arrays in C language. int (*arr2)[8]; What happens if you dereference arr2?You get an array of 8 integers. Geeksforgeeks has a Dec 13, 2013 · The whole purpose of the special rules around arrays is so that you can use a pointer to an array element as though it were an array. 1/3 - Other operands - Lvalues, arrays, and function designators): Except when it is the operand of the sizeof operator or the unary & operator, or is a string literal used to initialize an array, an expression that has type ‘‘array of type’’ is converted to an expression with type ‘‘pointer to type’’ that points to the initial element You will also learn to access array elements using pointers with the help of examples. So instead, the type of &array1 is int (*)[2], which means "pointer to an array of size 2 of int", or "pointer to an array of size 2 of type int", or said also as "pointer to an array of 2 ints". Note that char **x; declares a pointer to a pointer. To make the above code to work, you can declare a as a pointer: int *a;. 6. Jul 6, 2012 · A pointer to int a[4] means 'a pointer to the address range a that is treated by the compiler as an array with int element width, where the compiler treats the start of the array as if it were a pointer to the array', and any operations on that type will be consistent in a derefernce chain i. When you are using pointer[5][12], C treats pointer as an array of arrays (pointer[5] is of type int[280]), so there is another implicit cast here (at least semantically). The reason they should be discussed together is because what you can achieve with array notation (arrayName[index]) can also be achieved with pointers, but generally faster. Pointer to a Two-Dimensional Array Definition and Explanation. char *pointer; A pointer to char can point to an array. This can be passed using double pointers to function. Pointers to arrays A pointer to an array points to the first element in the array. You can define a pointer to an array, for example this: double (*p Sep 22, 2009 · Here's what the standard says (C99 6. you must at compiler level use (*a)[0] to access the first element if the type is a pointer to an student newStudent = {"john", "smith", 1, 12, 1983}; //add it to the array students[arrayIndex] = newStudent; arrayIndex++; Subject the array not being used outside of scope of newStudent. Command-line arguments: The main function in C accepts a double pointer, argv, which is an array of strings passed from the command line. You can declare a pointer to an N-element array of T and do something similar: Dec 15, 2011 · C functions that need to return an array usually do so by simply taking a pointer and a max size as arguments, and writing into that space. Jan 10, 2025 · The following examples demonstrate the use pf pointer to an array in C and also highlights the difference between the pointer to an array and pointer to the first element of an array. Note that the parenthesis is important: The * has less precedence than the [7], so otherwise this would be taken as an array of 7 pointer to integers. A pointer to an array looks like this: int (*aptr)[N] Where N is a particular positive integer (not a variable). 5. Pointer to an array will point to the starting address of the array. Specifically, you can't do: int a[10], b[10]; a = b; // cannot work in C++ (or C) If you create the array dynamically and assign pointers: Aug 6, 2012 · int *a[], when used as a function parameter (but not in normal declarations), is a pointer to a pointer, not a pointer to an array (in normal declarations, it is an array of pointers). *p + i points to ith array in A i. It can be visualized as a matrix or a table with rows and columns. int *p; // p is a pointer to int int ArrayOfIntegers[5]; // ArrayOfIntegers is an array of 5 integers, // that means it can store 5 integers. When you indirect through the pointer to array, the result is an array, and when you add an integer to an array, the array decays to pointer to element of that array and since *p is an array of integers, the decayed pointer points to an integer Apr 21, 2016 · For example, for an array of double, you write new double[size];. ) 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 the type as with int (*array_pointer)[3]. We can use pointer arithmetic or bracket notation to access the elements in the array. We use pointers to pass information back and forth between a function and its reference point. Using the name of an array when passing an array to a function will automatically convert the argument to a pointer per the C specification (emphasis mine). " In most cases, I would prefer the array form. If you do p[1], for example, you move the pointer along to the "next" array and attempt to dereference it: Apr 6, 2021 · p is a pointer to integer array of size 3. Dec 28, 2015 · GCC-gnu. It is the pointer to the first element of the pointer instead of the whole array but we can access the whole array using pointer arithmetic. To create an array of pointers in C language, you need to declare an array of pointers in the same way as a pointer declaration. This means that you are indexing the pointer to the array. C's pointer and array semantics are such that you can apply the subscript operator [] to either an expression of array type or pointer type; both src[i] and dst[i] will access the i'th element of the array (even though only src has array type). The function will assume that the pointer you give it is pointing to some sequence of uint8_ts somewhere - that is why you have to pass the array size as another parameter, because it does not Nov 12, 2014 · Here, p refers an array of character pointer. This differs from OP's code as the pointer point is not a pointer to an array, but a pointer to an int. example: for the 1st character, use p[0], 2nd character, use p[1] and so on. Jun 27, 2009 · Unlike a plain pointer, this hints about array size, theoretically allowing compiler to warn about passing too-small array and spot obvious out of bounds access. Multilevel pointers provide multiple layers of indirection in C. All this copying back and forth should be a red flag that something wasn't right. void func( int B[5][10] ) // this func is actually the same as the one above! Nov 28, 2009 · When typedef is not used to create a type for the pointer-to-array (in a common header file), then a global pointer-to-array needs a more complicated extern declaration to share it across files: fileA: char (*p)[10]; fileB: extern char (*p)[10]; May 25, 2011 · The last part reads as "pArr is a pointer to array of MAX elements of type pointer to int". Mar 18, 2019 · In C and C++, when we have an int* type pointer that is intended to point to the first element of an array, we do not have a direct way to know the length of the array using the pointer alone. g, from reading a text file without knowing its length or gathering user input of unspecified length), then you'd need a dynamic array of Char* and so you'd need a Char**. The double pointer would be pointing to the first pointer in the pointer array, which will point to the first element in the first row. Return the sum of the first and last elements of the array. In this chapter, we will explain in detail the relationship between arrays and pointers in C programming. Application of Double Pointers in C. A simple example to print the address of array elements Aug 1, 2011 · It just wants a pointer to the beginning element. We can store almost all types of data as array elements. A pointer in C is a variable that represents the location of an item, such as a variable or an array. It is a variable that points to a data type (like int or string) of the same type and is created with the * operator. In the below code, the type of ptr is pointer to an array of 10 integers. A two-dimensional (2D) array is an array of arrays. It is because ptr is a pointer to an int data. while char * volatile x means that 'x' is a volatile pointer to a char. I am putting this up on my Github account as it appears that Ted has taken down his website where this tutorial was located. The function takes an array of integer array and an integer array_size, which is the length of the array. Jan 3, 2015 · The C specification says that array and &array are the same pointer address. 6. Nov 19, 2010 · This is the point from ISO :Standard Conversions:Array-to-pointer conversion: $4. Here, each pointer in the array is a character pointer that points to the first character of the string. Later, when you want to use that element, copy the array element into it's aproprate pointer to make the compiler happy. So, if we move ptr by 1 position it will point the next block of 5 elements. Syntax of a Pointer in C++: data_type_of_pointer *name_of_variable = & normal_variable; What is a Pointer to a Pointer or Double Pointer Dec 23, 2024 · C Pointers and Arrays. p + i would be a pointer to an array. 7. Correct. At this point, you're 3/4 way to making a 2d array, since 2d arrays consist of a list of pointers to arrays. ” The result is a pointer to the first element of the array. Note: The address between ptr and ptr + 1 differs by 4 bytes. Jul 4, 2011 · Only array types adjust to pointer types. Sep 13, 2019 · This is because arrays decay into pointers, meaning that if an expression of type char[] is provided where one of type char* is expected, the compiler automatically converts the array into a pointer to its first element. For example, if array = [10, 20, 30, 40, 50] and array_size = 5 , the expected output is 60 . In C the size of array is stored in the type, not in the value. See examples, output and explanations of pointer to array concepts. C Nov 21, 2013 · POINTER TO AN ARRAY. Your example function printSomething expects a pointer, so if you try to pass an array to it like this: Jan 19, 2022 · Instead of fixed-size arrays, using double pointers allows for flexible dimensions. And, the size of int int (*pa)[]; a pointer to an array of ints int (*pf)(); a pointer to a function returning an int. Address Value 0x7ffeea3c9498 42 0x7ffeea3c9494-5 0x7ffeea3c9490 14 Apr 9, 2014 · std::array has a template parameter for size. Another method for passing the fixed-sized array is to declare a function parameter with int* var notation and return the pointer value after the function body is done processing it. 2 Array declarators and discusses subscripting in C11 Standard - 6. Aug 11, 2020 · 1. Nov 28, 2022 · A Two Dimensional array of pointers is an array that has variables of pointer type. Arrays in C. Following are the main uses of pointer to pointers in C: They are used in the dynamic memory allocation of multidimensional arrays. Pointers to an array is the pointer that points to the array. The array that is being pointed to is called 'array' and has a size of n. Why pointers and arrays? In C, pointers and arrays have quite a strong relationship. Create an Array of Pointers. , as needed in an application where you may need to store a variable number character strings e. Most manipulation of arrays are done via pointers to individual elements, not via pointers to the array as a whole. In your second example, you explicitly create a pointer to a 2D array: Apr 25, 2018 · With C99+ you can create a Variable Length Array (VLA) of pointers, e. An array is a series of contiguous elements. " So the decoded typename for shapes is: An array of pointers to an array of 3 integers. Dec 3, 2024 · For passing 2d array to function using pointer, refer to this article - Pass a 2D array as a parameter Pointers and 3D Arrays. This pointer points to the whole array and not just the first element, in the same way that a float * points to the whole float and not just the Jan 27, 2023 · In C++ a Pointer is a variable that is used to store the memory address of other variables. An array name acts like a pointer constant. This C Tutorial Explains Pointer to Array in C with Example(s). 3 by Ted Jensen. Jan 5, 2011 · Here's the exact language from the C standard ():6. Apr 5, 2017 · An array is not a pointer (although a name of an array often decays to a pointer to its first element). Jan 10, 2025 · Explanation: Array of strings are generally stored as array of pointer to strings. 3. In C programming language, pointers and arrays are closely related. In this article, we will discuss some of the major applications of pointers in C. Let’s commence our journey with a comprehensive understanding of pointers to arrays. Sep 8, 2023 · The Array Lowdown Why All the Fuss: The Importance of Pointers in Arrays The Syntactic Sugar Coating What’s in a Name: The Array Name as a Constant Pointer The Great Swap: Array Indexing vs Pointer Arithmetic The Love Triangle: Arrays, Pointers, and Functions Why Functions Love Pointers More Large Sample Code: Dynamic Memory Allocation for 2D Jul 27, 2020 · here p is an array of 10 integer pointers. Explanation of the program. Incorrect. We use array to store a collection of similar type data together. It can be visualized as multiple 2D arrays stacked on top of each other. Apr 4, 2010 · Note that C++ smart pointers have their own methods (like use_count() for shared_ptrs), so there it is necessary to distinguish between calling a method on the pointer vs. e. This is A TUTORIAL ON POINTERS AND ARRAYS IN C Version 1. The following program demonstrates this concept. C distinguishes between object pointers and function pointers (void * is an object pointer), and C does not allow conversion between them. In this article, we will learn how to create an array of pointers to strings myMax expects a float array pointer (float *) so I use &arr to get the address of the array, and cast it as a float pointer. I get that value by using sizeof() to give me byte sizes of the array and the first element of the array, then divide the total bytes by the number of bytes in each element. This means that the variables stored in the 2D array are such that each variable points to a particular address of some other element. Array is a data structure that hold finite sequential collection of similar type data. Apr 28, 2015 · Arrays aren't bounded or terminated in a standard way, and a pointer (address in memory) will never be NULL after iterating through an array, and the contents a pointer is pointing to could be anything. Multilevel Pointers in C. If you really want to have two arrays and copy contents from one array to another, you should copy the data Jan 16, 2012 · For an array of 20 characters, counting the NUL terminator, you don't need a pointer. Sep 24, 2017 · In this guide, we will learn how to work with Pointers and arrays in a C program. . I find this tutorial on pointers in C to be one of the best out there and well worth preserving. This works since you can implicitly cast arrays to pointers (to the first element). I recommend you to refer Array and Pointer tutorials before going though this guide so that it would be easy for you to understand the concept explained here. Syntax: char *array_name [array_size]; Dec 14, 2014 · But as mentioned in other answers, it's not that common to do this. How to create a 2D array of pointers: A 2D array of pointers can be created follo Feb 11, 2024 · In C programming, a double pointer is a pointer that points to another pointer. Oct 11, 2010 · Still the decay of an N dimensional array to a pointer to N-1 dimensional array is allowed by c++ since you can lose the leftmost dimension and still being able to correctly access array elements with N-1 dimension information. " is true, but, the variable name for the array is the same as a pointer const (this is from my old Coriolis C++ Jan 10, 2025 · Array in C is one of the most used data structures in C programming. Since pc and c are not initialized at initially, pointer pc points to either no address or a random address. So volatile char * x means 'x' is a pointer to a volatile char. Syntax to Declare Array Pointer Jul 30, 2024 · Array of Pointers to Character. type *array[var]; /* create var number of pointers to type */ The standard defines both in C11 Standard - 6. An array of pointers will be discussed in upcoming chapters. So idiomatic C generally doesn't care that arrays and pointers aren't the same thing, and the rules prevent you from doing much of anything useful directly with arrays. You'd do better, on the whole, to devise a different way of handling things. Sep 11, 2013 · "In C/C++, pointers and arrays are not the same thing. nihcncdpefauluspqsululjddgtvgmkvdvilvkghebgon