when、where、why、how 本身都是副词,它们多数具有以下几种语法功能。
1. [疑问副词] 构成特殊疑问句,如:
When will he come? 他什么时候来?
Where did you go? 你上哪去了?
Why did you write to him? 你为什么给他写信?
How does he do it? 他是怎样做的?
2. [连接副词]
① 构成名词从句,如:
When he will be back has not dedided. 他什么时候回来尚未决定。(主语从句)
That is where we are going. 我们就是去那里。(表语从句)
Tell me why you are late again. 请告诉我为什么你又迟到了。(宾语从句)
I told her how to find me. 我告诉她怎样才能找到我。(宾语从句)
② 构成状语从句,如:
It was raining when we started. 我们动身时正下着雨。(时间状语)
Where there is a will there is a way. 有志者事竟成。(地点状语)
3. [关系副词] 构成定语从句 (how 不能用作关系副词),如:
I still remember the night when Nanjing was liberated.
我还记得南京解放那天晚上的情景。
This is the house where I was born. 我就是出生在这幢房子里。
That's the reason why I wrote to him. 那就是我写信给他的原因。
本身就是副词怎么可能作代词呢,你的理解是错误的,就算是在定语从句中也是相当于介词+关系代词
when 、where、why、how是副词,不可以作代词使用。