3i Infotech Placement: Sample Questions 32 - 34 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 32

Edit

Write in Short

Short Answer▾
  1. main ()
  2. {
  3.     printf( “%p” main);
  4. }

Explanation

  • In a program
Table Shows the Program
  1. main ()
  2. {
  3.     printf( “%p” main);
  4. }
Function names are just addresses (just like array names are addresses) .

Here, main () is also a function.

So, the address of function main will be printed.

  • % p in printf specifies that the argument is an address.
  • They are printed as hexadecimal numbers.
  • Some address will be printed

Question 33

Edit

Describe in Detail

Essay▾

When do you get constraint violation? What are the types of constraints?

Explanation

Database returns an error message when a constraint is violated.

Different type of constrains:

  1. Domain Constraints: A Domain constraint deals with one or more columns
  2. Entity Constraints
  3. Referential Integrity Constraints.
  4. Key Constraints
    • Primary Key Constraints
    • Foreign Key Constraints
    • Unique key Constraints
    • Check constraint
    • Default constraint

Question 34

Edit

Write in Short

Short Answer▾

How is structure passing and returning implemented by the compiler?

Explanation

  • When structure is passed as argument to functions, the entire structure is pushed on the stack, using as much memory as required.
  • Some compilers merely pass a pointer to the structure, though they may have to make a local copy to preserve pass-by-value semantics.
  • Structures are often returned from functions in a location pointed to by an extra, compiler-supplied “hidden” argument to the function.
  • Compilers used a special, static location for structure returns, although this makes structure-valued functions non-re-entrant, which ANSI C disallows.

Developed by: