C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Mystrlen using Pointers in C
WhatsApp
Ashique Vlcy
Jan 26
2016
4.3
k
0
0
#include<stdio.h>
main()
{
int
mystrlen(
char
*);
char
str[100];
char
*p;
p=str;
printf(
"Enter the string..?\n"
);
scanf(
"%s"
,p);
int
x=mystrlen(p);
printf(
"Length of string is=%d\n"
,x);
}
int
mystrlen(
char
*p)
{
int
c=0;
while
(*p!=
'\0'
)
{
c++;
*p++;
}
return
(c);
}
c
functions
pointers
string
Up Next
Mystrlen using Pointers in C