Skip to content

Instantly share code, notes, and snippets.

@HammadMaqbool
Created August 5, 2016 16:19
Show Gist options
  • Save HammadMaqbool/adaae3865002684d89210582411664df to your computer and use it in GitHub Desktop.
Save HammadMaqbool/adaae3865002684d89210582411664df to your computer and use it in GitHub Desktop.
#include<iostream.h>
#include<conio.h>
class Temp{
public:
Length(char a[])
{ int len=0;
for(int i=0; a[i]!='\0'; i++)
{
len=len+1;
}
cout<<len;
}
};
void main()
{
char b[100];
Temp obj;
cout<<"Enter String To compute Length";
cin>>b;
obj.Length(b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment