Generate intermediate files ( assembling, preprocessing) in gcc

Let’s start with some GCC commands as shown below. [terminal] [root@humbles-lap gcc]# gcc -S -c program.c [root@humbles-lap gcc]# ls program.c program.s [root@humbles-lap gcc]# file program.s program.s: ASCII assembler program text [root@humbles-lap gcc]# cat program.s |head -n 5 .file “program.c” .section .rodata .align 8 .LC0: .string “\n I am always an example program” [/terminal] How-ever it …

Read more

Find integer array size in C programming

Someone asked me once “how can I get integer array size in C programming and use it in the code?”.Unfortunately there is no defined standard function to get that in C. Rather you could use below method .Suppose you have defined an integer array ( static ) called , int intArray[10];Its size can be derived …

Read more