Programming Language C
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment