#include
#include
#define MAX 30
void push(char );
char stack[MAX];
int tos=0;
int main(){
char str[]=\"Arijit Saha\";
char *f
reverse is a local array. It is destroyed, when the function exits, but you return a pointer to its contents. Ideally, you should return the array by having a parameter that the function will load data into, i.e.
void MyFuncReturnsArray(int* myArr, int n)
{
for(int i = 0; i < n; ++i)
myArr[i] = i;
}
Instead of
int* MyFuncReturnsArray()
{
int myArr[10];
for(int i = 0; i < 10; ++i)
myArr[i] = i;
return myArr
}