On 06 Apr 2007 10:32:22 -0700, sunil_h_v <[EMAIL PROTECTED]> wrote:
> hey guys why dont you use pointers???
> i tried it works fine with me
>
> #include <stdio.h>
> #include <conio.h>
> #include <string.h>
> #include <alloc.h>
> void fun(char **arr)
> {
>   printf("%s\n",arr[0]);
>   printf("%s\n",arr[1]);
> }
> void main()
> {
>   char **arr;
>   clrscr();
>   strcpy(arr[0],"1asdf");
>   strcpy(arr[1],"2sdf");
>   fun(arr);
>   getch();
> }

Did you actually compile this and run it? You don't allocate any
memory for char **arr and then try to copy something into it... what
do you think is going to happen here?

Also, clrscr() and getch() (and conio.h in general) are not standard
functions and are particular ot the old Borland compilers.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to