Here's the problem:
a. Write a C program that has a declaration in main() to store the string "Vacation is near" into an array named message. There should be a function call to display() that accepts mesage in a parameter named strng and then displays the message using the pointer notation *(strng + i).
b. Modify this display() function to alter the address in message. Use the expression *strng rather than *(strng + i) to retrieve the correct statement.
Here's the code I have so far:
Code:#include <stdio.h> void display(char[]); int main() { char message[] = "Vacation is near"; display (message); return 0; } void display(char strng[]) { int i=0; while(*(strng + i) != '\0' { printf("%c", *(strng+i)); i++; } printf("\n"); return; }