Determine specific size for console in C

5

Is it possible to set a specific size for the codeblock console (In C language) to open when I run the program?

I need it to open in a certain size because I will not use the whole screen.

I saw that there is a way to do it in the windows.h library but I wanted it for ubuntu and I'm not finding it.

Note: Codeblock is the editor I'm using to program C in ubuntu

    
asked by anonymous 19.11.2015 / 21:50

2 answers

3

The command line that codeblocks uses to activate the console can be changed in settings - > Environment - > General Settings.

In linux the default is:

xterm -T $TITLE -e

You can change the xterm command line by changing the size of the window. Take a look at the -geometry parameter in the xterm documentation.

    
20.11.2015 / 00:05
2

The gnome-terminal --geometry=20x20 -e ./meuprograma command opens a Gnome terminal window of size 20x20 (measured in characters) already running the program meuprograma located in the current directory.

You can make a script file that runs this command (that is, a .sh file with this command inside and marked as an executable) and distribute it in the same folder as the binary. This will give the effect you want. As for Code :: blocks, I can not tell what it does or how it does, but that is irrelevant because it is just the IDE and has no relation to the final program.

    
20.11.2015 / 00:05