answersLogoWhite

0

#include
void

printarr(int

a[]);
void

printdetail(int

a[]);
main()
{
int

a[5];
for

(int

i = 0;i<5;i++)
{
a[i]=i;
}
printdetail(a);
}
void

printarr(int

a[])
{
for

(int

i = 0;i<5;i++)
{
printf("value in array %d\n"

,a[i]);
}
}
void

printdetail(int

a[])
{
for

(int

i = 0;i<5;i++)
{
printf("value in array %d and address is %8u\n"

,a[i],&a[i]);
}
}
void

print_usingptr(int

a[])
{
int

*b;

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Is it possibly to return an array of strings in a function without using pointers in C plus plus?

No.


Would you Write c plus plus program using array for Fibonacci number?

You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....


Difference between array and pointers in c plus plus?

A pointer is simply a variable that can store a memory address and has the same purpose in both languages. The only real difference is that C++ pointers can point at objects (instances of a class) and indirectly invoke their methods, whereas pointers in C (which is not object oriented) cannot.


Array implementation of priority queue example program in c plus plus?

yes


Can you help me with the C plus plus code of the program which has 10 index of array it adds 5 into every even elements of the array and then it subtracts 10 into the odd elements of the array?

int array[10] = {...}; for (int i = 0; i &lt; 10; ++i) { if (i % 2 == 0) array[i] += 5; else array[i] -= 10; }


Can you write a program to read a set of scores from a file and compute the average and print it on the screenby c plus plus?

Yes. Use cin and/or getline to read the formatted data into an array, compute the average then output the result using cout.


How to write a code for finding sum of left diagonals elements in an array using c plus plus?

truzi i Ghal


How calculate the average scored by student for is subject in c plus plus program?

Put all the values in an array, iterate through the array with a for loop, sum all the values, then divide by the count of the values.


What is the difference between c plus plus and java programming?

Java doesn't have pointers. C++ has pointers.


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


How do you write a program in c plus plus to check if an array is symmetric?

To determine if an array is symmetric, the array must be square. If so, check each element against its transpose. If all elements are equal, the array is symmetric.For a two-dimensional array (a matrix) of order n, the following code will determine if it is symmetric or not:templatebool symmetric(const std::array& matrix){for (size_t r=0 ; r


Program in c plus plus to delete an element in sorted array?

If the array is dynamic then use a vector instead of an array. You can then use the vector::erase() function to delete an element or a range of elements. Remember that if the vector contains pointers to unshared memory, then you must release the pointer before erasing the element containing that pointer. If the array is static then you cannot delete elements. The assumption with static arrays is that you will neither add nor delete, you will only modify existing elements. However, you can emulate a deletion by shunting elements to the left, and keeping track of how many used elements there are (which must always be less than or equal to the upper bound plus one). Again, if the array contains pointers to unshared memory, you must release the pointer before shunting elements. You can also do the same thing with dynamic C-style arrays, but once you've shunted elements to the left you can reallocate the array with the new size to physically delete the final element.