C++ Foundation —— (08) C++14 Functions and L,R Value
»
    I write this website for myself and perhaps for my children. And the main purepose is for you who want to hire me to finish a task or hire me for a job in the very very future.

    I'm not interesting in others' opinions, I write what I know and what I learned to let you know what I can do.

    This article shows the usage of a function in C99 and C++14.

    The example of a function like this:

int main(int agrc, char* argv[]){
    return 0;
}

    In any function, there can be no return statement, even if the return value type is not void.
    The function will return a random default value with the return value type while there is no return statement.

    By the way, I want to show you the difference between L-Value and R-Value in my practice:

    L-Value: there must be a value label which pointing to the memory space of the value.
    R-Value: there must not be a label which pointing to the memory space of the value.

    L-Value will call disconstructor function while the value label is being removed from memory.
    R-Value will be destroyed automatically if no label point to the returned data after a function returned.
    R-Value will not be destroyed while some new label point to the returned data after a function returned.
    R-Value will be destroyed automatically after some old label received the members' data from the R-Value if some old label assigned by R-Value.
            
«
--Alex.Zhang
--www.v-signon.com Learningers Co-Encouraged
Back
Personal Art: www.up-task.com Unit: Individual
中文 Русский 京ICP备19038994号-2
If the content on this website infringes upon your any rights, please contact me at 1307776259@qq.com for removal