COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Syntax for variable definition in C#:
A
<data ____ type><variable ____ list>;
B
<variable ____ list><data ____ type>;
C
<eference ____ list><data ____ type>;
D
<variable ____ list><data ____ field>;
Explanation: 

Detailed explanation-1: -Syntax. type variableName = value; Where type is one of C types (such as int ), and variableName is the name of the variable (such as x or myName). The equal sign is used to assign a value to the variable.

Detailed explanation-2: -dataType variableName = initialValue; This declares a variable, declares its data type, reserves memory for it, and puts an initial value into that memory. The initial value must be of the correct data type.

Detailed explanation-3: -Declaration means that variable is only declared and memory is allocated, but no value is set. However, definition means the variables has been initialized. The same works for variables, arrays, collections, etc.

Detailed explanation-4: -In C programming, a character variable can hold a single character enclosed within single quotes. To declare a variable of this type, we use the keyword char, which is pronounced as kar.

Detailed explanation-5: -All variable names must begin with a letter of the alphabet or an underscore( ). After the first initial letter, variable names can also contain letters and numbers. Variable names are case sensitive. No spaces or special characters are allowed.

There is 1 question to complete.