Tag: C

Linux – Writing Fault handlers

Every Linux C/C++ developer is familiar with the message “Segmentation fault (core dumped)” , It can happen by accessing wrong memory address, making a floating point error and more. To find out the problem, you need to enter debug mode or use the core dump Post mortem – core dump While the program is loading […]

Read more

Linux Shared Libraries

While writing applications in linux , the developer can use tons of libraries. Each library can packs functions, classes and variables and it is very  important to understand how to create and work with it. Lets start with simple example: Implicit link

To compile the library we use:

Here we use -g3 to […]

Read more

C Pitfalls – Test yourself (what will be printed)

C is a great programming language , very fast , almost low level but its because the responsibility to write a good working code (and secure) is the developer. Array access , type casts, function parameters and more are not checked by the runtime so if you do something wrong – you crash It is […]

Read more

The C preprocessor

The C preprocessor is the first step of the code translation process. It performs some editing tasks before the compiler starts . With Standard C has come a number of useful and powerful techniques that make the preprocessor a genuinely useful tool to the C programmer. The preprocessor is a powerful but must be used carefully (pitfalls) […]

Read more

C and Assembly

No one wants to write assembly code!!!. It is complex, hard to code, hard to debug and not portable. Sometimes we have no choice for example if performance is super critical or if we want to use some specific SIMD instructions etc. So why we need to learn and write assembly code? Optimization – in […]

Read more