get terminal width and cursor position

I want to get the screen width and cursor positions.
When I used curses, all the screen content was cleared.
So Can I use curses to get the screen size without clearing anything in the window?

Or is there any other alternative???

I can use only C or C++.