what is a scope in c++ code example

Example 1: what is restrict keyword in c

#include <stdio.h>

// The restrict keyword basically says:
/* 
	The following pointer can only point to itself.
    So, if we use the restrict keyword, the mem location
    of the pointer is only to itself, we cannot point
    another pointer to the restricted pointer
*/

// EXAMPLE
void TakeIn(int* restrict Num1, int num2) {
  // UNDEFINED BEHAVIOR, Num1 is restrict, only points to itself
  Num1 = &num2;
  
  // num2 will be added by Num1
  num2 += Num1;
}

int main(void) {
  int A = 10;
  int b;
  TakeIn(A,b);
}

Example 2: what is monad in javascript

function Identity(value) {
    this.value = value;
}

Identity.prototype.bind = function(transform) {
    return transform(this.value);
};

Identity.prototype.toString = function() {
    return 'Identity(' + this.value + ')';
};

Tags:

Cpp Example