UNIX & GNU/Linux - gcc - Commands -v

With the -v command of the gcc, you can see all programs invoked by the compiler. Let's try with an example of the -v command:

gcc -v

Result (certainly different on your system):

UNIX & GNU/Linux - Tips and tricks - Change keyboard language

An easy way to change the keyboard language on Linux is to write this command on your favourite terminal:

setxkbmap lang

Where lang is the language you want. As an example to change the keyboard in french:

setxbmap fr

Or for an american keyboard:

setxbmap us

 

C - Pointers - Some examples

We can see with examples below that myString[0] == *myString == *(&myString[0]) == H.

Why?

Because myString[0] points the first character of the string "Hello World", in this case "H".

C - Unary operators - Using sizeof()

The sizeof() unary operator is often used, so it is important to know some tricks that we can do with it.

It is used to calculate the sizes of datatypes and it takes one argument: the type.

The main purpose of sizeof() is of course to allocate memory in conjuction with malloc.

C - Library functions - Using free()

The free() function is the sister of the malloc() function. As malloc() returns the address of the first byte of the allocated memory, free() accepts, as only parameter, the address of this first byte.

C - General Programming - Beep function

In this tutorial we will see a simple beep function. Let's take an example of the beep function:

UNIX & GNU/Linux - System calls - Using tgetflag()

The tgetflag() function is a Linux system call function. It is designed to be used with the getenv() and tgetent() functions.

UNIX & GNU/Linux - System calls - Using tgetnum()

The tgetnum() function is a Linux system call function. It is designed to be used with the getenv() and tgetent() functions.

UNIX & GNU/Linux - System calls - Using tgetent()

The tgetent() function is a Linux system call function. It is designed to be used with other termcap functions such as:

UNIX & GNU/Linux - System calls - Using getenv()

The getenv() function is a Linux system call function.

It is designed to know what is the name of an environment variable.

The main use is for the "TERM" variable. Let's see an example of the getenv() function:

Pages

Subscribe to BadproG.com RSS