Sunday, 19 July 2020

Extern Variable



External variables are used to make global variables. Extern variable defined outside the function. These variables are available globally throughout the function execution. The value of global variables can be modified by the functions. “extern” keyword is used to declare and define the external variables.

Cookies PHP


A cookies is a variable set on server normally used to identify a user.  A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. A cookie can only be read from the domain that it has been issued from.


Syntax 

setcookie(name, value, expire, path, domain, secure, httponly);


  1. Name: It is used to set the name of the cookie.
  2. Value: It is used to set the value of the cookie.
  3. Expire: It is used to set the expiry timestamp of the cookie after which the cookie can’t be accessed.
  4. Path: It is used to specify the path on the server for which the cookie will be available.
  5. Domain: It is used to specify the domain for which the cookie is available.
  6. Security: It is used to indicate that the cookie should be sent only if a secure HTTPS connection exists.

Saturday, 18 July 2020

Macro C Language

 What is macro? Define a macro to compute maximum of two arguments passed to it.



macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro. There are two kinds of macros. They differ mostly in what they look like when they are used. Object-like macros resemble data objects when used, function-like macros resemble function calls.
#include <stdio.h>

#define MAX(x,y) ((x>y)?x:y)
/*=======================
     Girfa Student Help
     Macro Demo
 ========================*/

fseek demo program

Q : Write a file statement to place a file pointer (fp) at the beginning of the record number (say R), where record size is B bytes.


Answer : 

#include<stdio.h>

#include<conio.h>

/*============================

     Girfa Student Help

     fseek demo

==============================*/