Program to pass string to a function and print in C
/*
C program to pass a string to a function
*/
#include <stdio.h>
void Strfun(char *ptr)
{
printf("The String is : %s",ptr);
}
// main function
int main()
{
// Declare a buffer of type "char"
char buff[20]="Hello Function";
// Passing string to Function
Strfun(buff);
return 0;
}
Program to pass string to a function and print in C
Output
need an explanation for this answer? contact us directly to get an explanation for this answer