Write a program using pointers to determine the length of a character string.

program:

main()

{
char*name;

int length;

name=”delhi”;

printf(“%s\n”,name);

while(*cptr != ‘\0’)
{
printf(“%c is stored at address %d\n”,*cptr,cptr);
cptr++;
}
length=cptr-name;

printf(“\n length of the string =%d\n”,lenth);
}          

0 Comment "Write a program using pointers to determine the length of a character string."

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

Loading...
இணைந்திருங்கள் 24 நேரமும்!! Like us on Facebook!)