Wednesday 13 September 2017

What is pointer? How is it initialized? What is indirection operator? What is the scale factor

Q : What is pointer? How is it initialized? What is indirection operator? What is the scale factor?

Solution: 


Pointer

A pointer is a special type of variable which hold physical address of a non pointer variable.Symbol * is used to make a pointer variable. Programmer can change a variable value from another location with the help of pointer. Call reference is an example of pointer , in which  a variable physical address pass to a function and any change made inside of function direct affect actual value of passed variable due to pointer.

Monday 11 September 2017

Structure C#

namespace ConsoleApplication1
{
    struct School
    {
        public int roll;
        public string name;
        public string city;
    }

Sunday 10 September 2017

Explain the working of shorthand assignment operators, pre and post increment operator and the ternary operator.

Q : Explain the working of shorthand assignment operators, pre and post increment operator and the ternary operator.

Solution : 

Assignment Operator

Prefix operator

Add or subtract a variable value by one. There are two types of prefix operator increment and decrement. If use in any expression or equation then first increment or decrement variable then solve related equitation with new value of related variable.

int a,b=10;

Assignment Operator


Question: What is the name = operator in mathematics?
Answer: is equal to

Write In C language terminology this operator is known as Assignment operator which is use to assign right hand side value into left hand size variable with overwrite mode. An assignment operator has following attributes.
  • Place right hand side data into left hand side variable.