Powered By Blogger

Wednesday 27 April 2011

A simple program to pass a string to another function using pointer and to print it from called function.


#include<stdio.h>
void pass(char *);

int main(void)
{
char *string="Subhabrata";
pass(string);
return 0;
}

void pass(char *pass)
{
int i=0;
char *t=pass;
t=pass;
for(i=0;i<10;i++)
{
printf("%c",*t++);
}
}

No comments:

Post a Comment