Try
cout << *(a+i*(p+1)+j);
But I think the below will also work. (The relationship between m
and n
vs r
and p
needs clarification.
for(i = 0; i <= r; ++i)
for(j = 0; j <= p; ++j)
cout << *a++;
More Related Contents:
- Function does not change passed pointer C++
- Return array in a function
- What is the point of function pointers?
- How do you pass a member function pointer?
- Is passing pointer argument, pass by value in C++?
- Returning a pointer of a local variable C++
- Function pointer vs Function reference
- C++ correct way to return pointer to array from function
- Explanation of function pointers
- Function pointer as parameter
- Pointer to array of unspecified size “(*p)[]” illegal in C++ but legal in C
- About Pointers To Functions in function declarations
- array of pointers as function parameter
- Why am I able to make a function call using an invalid class pointer
- Function returning array but main showing garbage [duplicate]
- Pointing to a function that is a class member – GLFW setKeycallback
- non-const pointer argument to a const double pointer parameter
- Differences of using “const cv::Mat &”, “cv::Mat &”, “cv::Mat” or “const cv::Mat” as function parameters?
- Dangling Pointers after Destructor is called
- What is the proper declaration of main in C++?
- Placement of the asterisk in pointer declarations
- Stack overflow caused by recursive function
- Why are NULL pointers defined differently in C and C++?
- What happens to the pointer itself after delete? [duplicate]
- Function in C++ returns by value or by reference?
- Get the first column of a matrix represented by a vector of vectors
- Function to mangle/demangle functions
- How much overhead is there in calling a function in C++?
- dereferencing a pointer when passing by reference
- C pointer notation compared to array notation: When passing to function