Wednesday, 19 March 2014

C Program for Using pointer to access array elements

/* Using pointer to access array elements */
main( )
{
char  name[ ] = "Klinsman" ;
char  *ptr ;
ptr = name ;  /* store base address of string */
while ( *ptr != `\0' )
{
printf ( "%c", *ptr ) ;
ptr++ ;
}
}

No comments:

Post a Comment