Sasken Papers: Sample Questions 26 - 27 of 35

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 26

» Aptitude

Short Answer Question▾

Write in Short

What are metacharacters?

Explanation

  • A metacharacter (sometimes spelled metacharacter or meta-character) is a special character in a program or data field that provides information about other characters. A metacharacter can express an idea about how to process the characters that follow the metacharacter, as the backslash character sometimes is used to indicate that the characters following it are to be treated in a special way. A common metacharacter usage is the wildcard character, which can represent either any one character or any string of characters. In UNIX shells, metacharacters include, but are not limited to these:
  • *; | ] [?
  • Each of these characters has a special meaning on the command line, and their use must be avoided for purposes other than their special meaning.

Question number: 27

» Aptitude

Short Answer Question▾

Write in Short

What are static variables and functions?

Explanation

  • Static is a keyword in C++ used to give special characteristics to an element. Static elements are allocated storage only once in a program lifetime in static storage area. And they have a scope till the program lifetime.
  • Static Variable: External/global variables have file scope and static storage duration. static used in a block means that the variable lives beyond the duration of the block, and is initialized only once.
  • Static Functions: By default any function that is defined in a C file is extern. This means that the function can be used in any other source file of the same code/project (which gets compiled as separate translational unit).