Question: Is a listener, for example the TextWatcher on the EditText, destroyed or removed when the view is scrolled off the screen. For example, I have a ListView where there are a few EditTexts in each ListView item. When the item is scrolled back onto the screen is it necessary to add a new listener to the EditText?

Answer: 
As `exch_2` expects addresses as parameters, you would have to call it `exch_2(&a,&b);`.

You are passing the values, and these are taken as addresses. If e. g. `a` has a value of `5`, the computer would try to use the value at address `5`on your computer - which probably is not accessible to your program.
Here is the correct code for your problem . Compile your original code with gcc -Wall . It will give you lot of warnings for your above code and preferably you need to fix all of them.
If you do not know linux and gcc please learn it. Do not use old tools like turboC compiler etc

```
void exch_1(int i, int j);   // declare function prototype for exch_1 --> call by value
void exch_2(int* i, int* j);  // declare function prototype for exch_1 --> call by reference

int main()
{
    int a,b;

    scanf("%d %d", &a, &b);
    printf("Before Call %d %d\n", a,b);

    exch_1(a,b);  // call by value. changes done in exch_1 are not reflected here
    printf("After first call %d %d\n", a,b);

    exch_2(&a, &b);   // --> please see the change here for call by reference, you 
                      //should  pass address as the parameters
                      // changes done in exch_2 can be seen here since we pass address
                      // In you original program you are passing value of a and b as the 
                      // address.When you try to access those values in exch_2 the it leads
                      // to undefined behavior and so you can get segfault as well.
    printf("After second Call %d %d \n", a,b);

    return 0;    
}

void exch_1(int i,int j)
//int i, j;    // you do not need these variables
{
    int temp;
    temp = i;
    i = j;
    j = temp;
}

void exch_2(int* i,int* j)
//int *i, *j;   // this line not needed
{
    int temp;
    temp = *i;
    *i = *j;
    *j = temp;
}

```