Relative Content

Tag Archive for c++arrayspointers

Understanding Pointers to Arrays in C++ [duplicate]

This question already has answers here: Why am I being told that an array is a pointer? What is the relationship between arrays and pointers in C++? (6 answers) Closed yesterday. In C++, there is a concept of a pointer to an array, where it is said to point to the “whole array” rather than […]

Understanding Pointers to Arrays in C++ [duplicate]

This question already has answers here: Why am I being told that an array is a pointer? What is the relationship between arrays and pointers in C++? (6 answers) Closed yesterday. In C++, there is a concept of a pointer to an array, where it is said to point to the “whole array” rather than […]

Is an array name a pointer?

Is an array’s name a pointer in C?
If not, what is the difference between an array’s name and a pointer variable?

char array and char pointer c++

#include <iostream> int main() { // char array char name1[] = “Hello”; std::cout << “name1 = ” << name1 << std::endl; std::cout << “&name1 = ” << &name1 << std::endl; std::cout << “*name1 = ” << *name1 << std::endl; std::cout << “name1[0] = ” << name1[0] << std::endl; std::cout << “&name1[0] = ” << &name1[0] […]