‚Č° Menu

C++

The question - I have a 64 bit processor and I would like to compile a 32 bit application using gcc. How do I do that? The C compiler gcc has a directive that can be used to instruct it to compile a 32 bit application instead of the default 64 bit application. Of course, [...]

{ 0 comments }

How to find the name of the Linux terminal in C++?

The question - I need to find the name of the terminal that is running my C++ code. Is there a C or C++ method that can give me the name of the terminal? The environment variable TERM contains the name of the terminal. [root@server c]# echo $TERM xterm [root@server c]# To get the environment [...]

{ 0 comments }

The question - how to check a script/application's return code in a Linux / Unix box? The answer to this question lies in the $? variable. Each program, when exits, has a return or exit code. The exit code of 0 (zero) means the program completed successfully and there was no error. To print the exit [...]

{ 0 comments }