How to read terminal attributes using ioctl()

I want to get the terminal attributes such as ,
terminal width
terminal height
current cursor position

Can I use ioctl function.
Please help me how to use this function to get these details..

If possible please explain with a sample code.

I'm very new to UNIX progrmming....

Thanks and Regards,
Sree

See: How to programm TTY devices under UNIX platform?