I want to return the address of variable `k` in function `func()`. Here is are the 2 functions.

> 
> **main()** Function
> 
> 
> 

```
#include <stdio.h>

main()
{
  int* j;
  int* func();

  j= func();
  printf("\n%d",*j);
}

```

> 
> **func()** Function
> 
> 
> 

```
int* func()
{
  static int k=30;
  return (&k);
}

```

I wanted `int *func()` to return the address of `k`, but following error was displayed.

`function returns address of local variable [-Wreturn-local-addr]`

`return (&k);`