3i Infotech Papers: Sample Questions 1191 - 1193 of 1245

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

Question number: 1191

» Basic CS » Operating System

Short Answer Question▾

Write in Short

Where are the auto variable stored? What are register variabes?

Explanation

  • Auto variable are stored in memory and their default value is a garbage value. Compare them with register variables below.

Register Variables

  • Register variables are meant to be stored in processor registers.

  • It may or get the place in a register depending upon whether there are sufficient registers available. Microprocessors have 14 to 16 registers and might already be occupied.

  • Registers are 16 bit so these statements should be avoided: register float i, register double j. The compiler wont show any error and will take them as auto.

Question number: 1192

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

How would you implement a substr () function that extracts a sub string from a given string?

Explanation

  • substr (string, position [, count] )

  • Returns the copied string starting at “position” for “count” characters or up to the end of the invoking string object, whichever comes first.

  • If only “position” is supplied, the function returns the string copied starting at index “position” until the end of the invoking string object.

  • If no arguments are supplied, the function returns a string identical to the invoking string object.

Question number: 1193

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is public, protected, and private?

Explanation

Public:

Public data members and member functions are accessible outside the class.

Protected:

Data members and member functions are only available to derived classes.

Private:

Data members and member function can’t be accessed outside the class.

Image of the public, protected and private

Image of the Public, Protected and Private

Image of the public, protected and private