Message from C, C++ talks

June 2019

— I heard functional programming, but i don't know what it is

— Okay thanks , can you explain how this code will behave?

— It tells the compiler that the memory which the variable ch represents may be edited by external sources at runtime

Message permanent page

— In turn, the compiler refrains from doing optimisations that may optimise away the variable and its uses

Message permanent page


Same here , what is OOP. ? the reason I'm in this group is because I love C++ naturally , but I've never understood how to structure C++ programs except the basics

— Thanks new byte for your explanation.

— One more question, It's based on Embedded C perspective

— What does actually happen when we declare a variable as static volatile unsigned char TMR0.

— This is declared inside a header file. Why the combination of static and volatile keyword.

— What context is the variable declared in?

— It's actually in the header file for PIC microcontroller, here the TMR0 is a timer zero register inside microcontroller. when we include this header file we can use this keyword.

Message permanent page

— Static volatile unsigned char TMR0 0x01;
static volatile unsigned char PCL 0x02;

— This is the real complete line at that file. Actually operator will write the value we given to the variable TMR0 inside the address 0x01 and same for PCL.

Message permanent page

— The static keyword means that the variable can only be "seen" inside the file it is declared

— But why these variables inside header file is declared as static volatile ...