Thursday, July 29, 2010

Pointers example

Pointers example

/* Example of pointers in C. Thsi program uses a function to modify a string using pointers */

#include< stdio.h>
#include< conio.h>
void main()
{
void getstr(char *ptr_str,int *ptr_int);
int var=5;
char *pstr="lionel";
clrscr();
getstr(pstr,&var);
printf("The value of var after modification using pointer in a function is %d,var");
}
void getstr (char *ptr_str,int *ptr_int)
{
printf("%s\n",ptr_str);
*ptr_int=6;
getch();
}


--
http://www.venkatmails.blogspot.com/

Venkat Mails, Fun , Cool pictures, Fun messages, Sardar Jokes, Quotations Moral stories Fun stories

http://www.venkatmails.blogspot.com/

No comments:

Post a Comment