Search Placementyogi.com
 

  :: Topics ::

1.

What is difference between object oriented and procedure oriented programming?

A: 

Procedure oriented language is based on function while object oriented is based on real world entity.

2.

What is the difference between char *a and char a[]?

A: 

char a[] = "string";

char *a = "string";

The declaration char a[] asks for space for 7 characters and see that its known by the name "a". In contrast, the declaration char *a, asks for a place that holds a pointer, to be known by the name "a". This pointer "a" can point anywhere. In this case its pointing to an anonymous array of 7 characters, which does have any name in particular. Its just present in memory with a pointer keeping track of its location.

char a[] = "string";

      +----+----+----+----+----+----+------+

a:    |  s  |  t  |   r  |   i  |  n  |  g  |  '\0' |

      +----+----+----+----+----+----+------+

       a[0] a[1] a[2] a[3] a[4] a[5]   a[6]

 

char *a = "string";

+-----+                 +---+---+---+---+---+---+------+

  | a: | *======>  | s  |  t |  r  |  i |  n |  g |  '\0' |

+-----+                 +---+---+---+---+---+---+------+

 

Pointer Anonymous array It is crucial to know that a[3] generates different code depending on whether a is an array or a pointer. When the compiler sees the expression a[3] and if a is an array, it starts at the location "a", goes three elements past it, and returns the character there. When it sees the expression a[3] and if a is a pointer, it starts at the location "a", gets the pointer value there, adds 3 to the pointer value, and gets the character pointed to by that value.

If a is an array, a[3] is three places past a. If a is a pointer, then a[3] is three places past the memory location pointed to by a. In the example above, both a[3] and a[3] return the same character, but the way they do it is different.

Doing something like this would be illegal.

char *p = "hello, world!";

p[0] = 'H';

3.

What's the difference between const char *p, char * const p and const char * const p?

A: 

const char *p    -   This is a pointer to a constant char. One cannot change the value pointed at by p, but can change the pointer p itself.

 

                     *p = 'A' is illegal.

                     p  = "Hello" is legal.

 

                     Note that even char const *p is the same!

 

const * char p   -   This is a constant pointer to (non-const) char. One cannot change the pointer p, but can change the value pointed at by p.

 

                     *p = 'A' is legal.

                     p  = "Hello" is illegal.

 

 

 

const char * const p  -   This is a constant pointer to constant char! One cannot change the value pointed to by p nor the pointer.

 

                          *p = 'A' is illegal.

                          p  = "Hello" is also illegal.

 
4. None
A:  None
4. None
A:  None
6. Null
A:  Null
7. What is Selenium ?
A: 

Selenium is an open source automation testing tool.

Used only for web based applications.

Supports writing of testcases in different languages like Html, C#, Java, Phython, Ruby etc.

Supports the execution of test cases on multiple web browsers such as Firefox, Chrome, IE, Opera, HtmlUnit, Android, iOS .

Mainly used for functional, regression and load testing.

Released under Apache 2.0 licence.

It can be downloaded from seleniumhq.org.

Highly flexible as it provides many options for locating UI element and comparing expected test results against actual application behaviour. It can be deployed on Windows, Linux, and Macintosh.

 

Banner to LogicGuns.com

Hide Page Information