Write a function void print_int_vector(int *ptr, int length) that prints the val
ID: 3572620 • Letter: W
Question
Write a function void print_int_vector(int *ptr, int length) that prints the values in the vector of integers indicated by ptr of length length to the standard output. A vector is a 1-dimensional array. For example, the following C statement declares an integer vector of 10 elements:
Write a function void print int vector(int ptr, int length) that prints the values in the vector of integers indicated by ptr of length length to the standard output. A vector is a 1-dimensional array. For example, the following C statement declares an integer vector of 10 elements int avector [10]; Each integer should be printed as a decimal number, one entry per line. You should not provide the main function only implement the print int vector function as described above Answer: CheckExplanation / Answer
void print_int _vector(int *arr, int n)
{
int i;
for (i = 0; i < n; i++)
{
printf( " %d", *arr)
/* second way*/
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.