Can we fix the terminal(console) size according to data displayed?
I am working in c++,and my O.S is kubuntu.Using c++ i can align the data displayed in cosole,
but before i want to change the terminal to a particular size.otherwise it is not aligned the data.
Any way to change the size of terminal according to the data dispalyed? If anybody knows about this .please reply me soon..

Instead of attempting to change the size of the terminal (not sure that is even possible) figure out how to align the data correctly. That will probably require knowledge of and use of terminfo information because every terminal may be different.

hai,
thanks for ur reply,
i just wrote a prgram in c++ that will aligh the output.ie In one line only 80 characters were displayed.If it exceeds ,next character will start from next line.Also words cannot broken in middle.But if the terminal is minimize or small(default) then it will not alighn data accordingly.So any way to adjust this terminal or anyway to keep the terminal size big?

i expect ur reply soon

You can use curses library to get standard format (I think). It's been many years since I programmed for *nix so I probably won't be much more help.

>So any way to adjust this terminal or anyway to keep the terminal size big?
That's poor design. Your program's output should conform to the environment, not the other way around. There are ways to find out the size of the console, and you can use those rather than hard coding a size or trying to force a size on the user.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.