UNIX & GNU/Linux - gdb - With Emacs

To start gdb, we have to add the -g flag at the compilation time.
So it is easy to add it in a Makefile. We are also using the Emacs IDE for running gdb.
Note that the code below does not work because we want to see the segmentation fault with gdb.

C - Linked lists - Simple example

Below, certainly the most easy example of the linked lists.

Let's see this example as a FILO, meaning First In Last Out:

Drupal 7 - Where to find - HTML body

Where to find the HTML body of Drupal version 7? Here the tree file until it:

/modules/system/html.tpl.php

Drupal 7 - Where to find - HTML header

Where to find the HTML header of Drupal version 7?

Here the breadcrumb until the file:

/modules/system/html.tpl.php

 

UNIX & GNU/Linux - Tips and tricks - Change the screen resolution

The command to change the screen resolution is xrandr, To see all size available for your screen:

$ xrandr

To choose the another one resolution just use the -s option with the resolution, for example:

$ xrandr -s 800x600

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

The open() system call function is used to open a file.

UNIX & GNU/Linux - tar - The xvf command

The xvf command of the tar tool allows to extract files from a file with the .tgz extension, in the current folder. Let's see an example of the xvf command:

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".

Pages

Subscribe to BadproG.com RSS