please help me..
am using turbo c 3.00
i'm gettin a compile time error : Lvalue required.


int func(int x,int y)
	int *ptr1=&x,*ptr2=&y;
	int **ptr_1,**ptr_2;

	printf("\nUsing function pointer : ");
	int sum=*ptr1+*ptr2;
	return sum;
	int *fnptr(int,int); // declare a function pointer

	fnptr=&func; //assigning address to fnptr- i get the error here
	printf("\nThe sum is %d",fnptr(10,20));

> am using turbo c 3.00
It's 20+ years out of date, and my guess is you're running XP or something as your main OS.

Congratulations, you've turned your Ferrari into a horse and cart.

Get code::blocks or visual studio express (details in a search engine near you).

Oh, and re-read ALL the forum rules until you figure out how to use code tags. It's only mentioned half a dozen times, how did you manage to miss all of them.

aha. Borland 3.0: preferred compiler of Amish Colonies everywhere.

>>i'm gettin a compile time error : Lvalue required.
which line?

Probably cause an immediate crash. Why? Where does ptr_1 point to? It's undefined because it was never set to point anywhere. You can't just use a double star pointer like you are trying to do -- they don't work like that.

Here is a simple example

int main()
    int x;
    int* p = &x;
    int**p1 = &p;
This article has been dead for over six months. Start a new discussion instead.