I have a problem with this code given below when i compile it without pointers it easily runs i want to run it by using pointer it gives me erro can any body runs the programme with pointers.
when i compile this without pointer it runs
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
void length(char st1[],int i)
{
i=strlen(st1);
cout<<endl<<"length of string st1 is ="<<i;
}
void main()
{ int i;
char st1[15];//,st2[15],st3[15],st4[15];
cout<<"Enter 1 strings :";
gets( st1);
cout<<"string is :"<<st1;
length(st1,i);
getche();
}
when i use pointer it no runs
void length(char *st1[],int *i)
{
* i=strlen(*st1);
cout<<endl<<"length of string st1 is ="<<*i;
}
void main()
{ int i;
char st1[15];//,st2[15],st3[15],st4[15];
cout<<"Enter 1 strings :";
gets( st1);
cout<<"string is :"<<st1;
length(&st1,&i); //gives only one error in this line
getche();
}