Tuesday, December 23, 2014

How to write a Test Case!

Read More

Sunday, December 21, 2014

The History of Technology in Education !

Read More

Interview Question On php for fresher

1.    What is PHP?
PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites.Even a non technical person can cretae sites using its CMS.WordPress,osCommerce are the famus CMS of php.It is also an object oriented programming language like java,C-sharp etc.It is very eazy for learning

2.    What is the use of "echo" in php?
It is used to print a data in the webpage, Example: <?php echo 'Car insurance'; ?> , The following code print the text in the webpage

3.    How to include a file to a php page?
We can include a file using "include() " or "require()" function with file path as its parameter.

4.    What's the difference between include and require?
If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

5.    What does a special set of tags do in PHP?

In PHP special tags the use of this Tags are The output is displayed directly to the browser.

6.    What is meant by nl2br()?

   Inserts HTML line breaks (

    ) before all newlines in a string.

   7.    What is use of header() function in php ? What is the limitation of HEADER()?
In PHP Important to notice the Limitation of HEADER() function is that header() must be called before any actual output is send. Means must use header function before HTML or any echo statement
There are Number of Use of HEADER() function in php like below
1> The header() function use to sends a raw HTTP header to a client.
2> We can use header() function for redirection of pages.
3> Used to refresh the page on given time interval automatically.
4> To send email header content like cc, bcc , reply to etc data and lot more.

     8.    How can we know the total number of elements of Array?

sizeof($array_var)
count($array_var)
If we just pass a simple var instead of a an array it will return 1.


9. Different Types of Tables in Mysql?

There are Five Types Tables in Mysql

1)INNODB
2)MYISAM
3)MERGE
4)HEAP
5)ISAM

10. Is multiple inheritance supported in PHP?
PHP includes only single inheritance, it means that a class can be extended from only one single  class using the keyword ‘extended’.

11. What is the meaning of a final class and a final method?
‘final’ is introduced in PHP5. Final class means that this class cannot be extended and a final method cannot be overrided.

12. How comparison of objects is done in PHP5?
We use the operator ‘==’ to test is two object are instanced from the same class and have same attributes and equal values. We can test if two object are refering to the same instance of the same class by the use of the identity operator ‘===’.

13. How can PHP and HTML interact?
It is possible to generate HTML through PHP scripts, and it is possible to pass informations from HTML to PHP.

14. What type of operation is needed when passing values through a form or an URL?
If we would like to pass values througn a form or an URL then we need to encode and to decode them using htmlspecialchars() and urlencode().

15. How can PHP and Javascript interact?
PHP and Javascript cannot directly interacts since PHP is a server side language and Javascript is a client side language. However we can exchange variables since PHP is able to generate Javascript code to be executed by the browser and it is possible to pass specific variables back to PHP via the URL.

16. What is needed to be able to use image function?
GD library is needed to be able execute image functions.

17.  What is the use of the function ‘imagetypes()’?
imagetypes() gives the image format and types supported by the current version of GD-                PHP.

18. What are the functions to be used to get the image’s properties (size, width and height)?
The functions are getimagesize() for size, imagesx() for width and imagesy() for height.

19. How failures in execution are handled with include() and require() functions?
If the function require() cannot access to the file then it ends with a fatal error. However, the include() function gives a warning and the PHP script continues to execute.

20.  What is the difference between static and Dynamic Web Sites?
The Web sites were made up of a collection of documents written in the HTML language. The pages were text based, simple, and static. Every time the user reloaded a page in his or her browser, it looked exactly the same. It consisted of HTML text, images, and links. 
                     A dynamic Web site is one with content that is regenerated every time a user visits or reloads the                        site. Although it can be as simple as displaying the current date and time, in most cases it requires                        the use of a database, which contains the site’s information, and a scripting language that can                                retrieve the information from the database. Google and Yahoo! are examples of dynamic sites,                              search engines that create customized pages based on a key word or phrase you type.
Read More

Interview Question On Java for Fresher !!!

1.      What is the difference between a constructor and a method?
A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.
A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.

             2.      What is Polymorphism?
The Polymorphism can be referred as one name many forms. It is the ability of methods to behave differently, depending upon the object who is calling it. The key features of Polymorphism are:
Allows using one interface for multiple implementations.
Supports Method Overloading: Multiple methods with same name, but different formal argument.
Supports Method Overridden: Multiple methods have the same name, same return type, and same formal argument list.

            3.      Explain garbage collection.
The Java uses the garbage collection to free the memory. By cleaning those objects that is no longer reference by any of the program. Step involve in cleaning up the garbage collection:
Garbage Object Collection: first step is to collection and group all those object which are no more reference with any of the program. We can use the different methods to collect the garbage object like using runtime.gc() or system.gc().
Run Finalize method: To free up those object which is collected by the garbage collector java must execute the Finalize method to delete all those dynamically created object

            4.      What is an immutable object?
An immutable object is one that we cannot change once it is created. Steps involved in creation of an immutable object are:
Make all of its data fields private.
Methods which can perform changes in any of the data fields after the construction of object must be avoided.
           5.      How are this() and super() used with constructors?
this() Constructors: is used to pointing the current class instance.
Can be used with variables or methods.
Used to call constructer of same class.
Private variable cannot be accessed using this().
super() Constructer: is used to call constructor of parent class.
Must be the first statement in the body of constructor.
Using this we can access private variables in the super class.

           6.      What are Access Specifiers available in Java?
           Java offers four access specifiers, described below:
Public: public classes, methods, and fields can be accessed by every class.
Protected: protected methods and fields can only be accessed within the same class to which the methods and fields belong.
Default (no specifier): when we do not set access to specific level, then such a class, method, or field will be accessible from inside the same package to which the class, method, or field belongs.
Private: private methods and fields can only be accessed within the same class to which the methods and fields belong. Private methods and fields are not inherited by subclasses.

           7.      What is Constructor?
           A constructor is used to initialize a newly created object.
It is called just after the memory is allocated for the object.
It can be used to initialize the objects.
It is not mandatory to write a constructor for the class.
Name of constructor is same as the class name.
Cannot be inherited.
Constructor is invoked whenever an object of its associated class is created.

             8.      What are the List interface and its main implementation?
            The List helps in collections of objects. Lists may contain duplicate elements. The main                                   implementations of the List interface are as follows:
ArrayList: Resizable-array implementation of the List interface.
Vector: Synchronized resizable-array implementation of the List.
LinkedList: Doubly-linked list implementation of the List interface. Better performance than the ArrayList implementation when elements are inserted or deleted timely.

         9.      Explain the user defined Exceptions.
         User Defined Exceptions are exceptions defined by the user for specific purposed. This allows custom           exceptions to be generated and caught in the same way as normal exceptions. While defining a User            Defined Exception, we need to take care of the following aspects:
It should be extend from Exception class.
Use toString() method to display information about the exception.

            10.  Describe life cycle of thread.
          Threads follow the single flow of control. A thread is execution in a program. The life cycles of threads             are listed below:
Newborn state: After the creations of Thread instance the thread is in this state but before the start() method invocation. Thread is considered not alive in this phase.
Runnable state: A thread starts its life from Runnable state. After the invoking of start() method thread enters Runnable state.
Running state: A thread first enters Runnable state.
Blocked state: A thread can enter in this state because of waiting the resources that are hold by another thread.
Dead state: A thread can be considered dead when its run() method completes. If any thread comes on this state that means it cannot ever run again.

               11.  What is an Applets?
          Applets: These are small java programs.
They can send from one computer to another computer over the internet using the Applet Viewer that supports java.
Applets can runs in a Web browser as it is a java program. It can be a fully functional Java application because it has the entire Java API at its disposal.
Applets follow the security rules given by the Web browser.
Applet security is also known as sandbox security.

             12.  What is the Set interface?
        A Set interface is collection of element which cannot be duplicated.
The Set interface contains methods inherited from collection.
It provides methods to access the elements of a finite mathematical set.
Two Set objects are equal if they contain the same elements.
It models the mathematical set abstraction.

              13.  What is a HashSet and TreeSet?
           The HashSet is an unsorted, unordered Set.
It is Collection set that restrict duplicate elements and also repositioning of elements.
It implements the Set interface and extends AbstractSet.
            Uses hash code of the object being inserted. 
          The TreeSet is a Set implemented when we want elements in a sorted order.

Sorting of element is done according to the natural order of elements or by the help of comparator provided at creation time.

14.  What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused.
A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.

15.  Describe synchronization in respect to multithreading.
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources.
Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.

16.  What is an abstract class?
Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie. you may not call its constructor), abstract class may contain static data.

17.  Any class with an abstract method is automatically abstract itself, and must be declared as such. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.

18.  What is the difference between an Interface and an Abstract class?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract.
An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.

19.  Explain different way of using thread?
The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance, the only interface can help.
           
            20.  When should I use abstract classes and when should I use interfaces?

Use Interface, when:
  • Design changing frequently or when various implementations only share method signatures.
  • We need some classes to use some methods which we do not want to be included in the class.
Use Abstract Class, when:
  • Various implementations are of the same kind and use common behavior.
  • Enabling with generalized form of abstraction and leave the implementation task with the inheriting subclass.
  • creating planned inheritance hierarchies



Read More

Friday, December 19, 2014

IT's Mobile Nightmares !!!

Read More

Agile: An Introduction

Read More

Steve Jobs rare footage conducting a presentation on 1980 (Insanely Great)

Read More

How to create your own software pt 1 : Getting started

Read More

.Net Framework Interview Questions and Answers

1) What are the advantages of .Net?
  • Good Design
  • Object-Oriented Programming – Using C# and .NET which are based on object-oriented Concepts.
  • Language Independence – All the languages which are supported by .Net ( VB.NET, C#, J#, and managed C++ ) are compiled in to common Intermediate Language (IL) . So IL make sure that languages are interoperable.
  • Efficient Data Access – ADO.NET provide fast and efficient way to access RDBMS, file system etc
  • Code Sharing – .To share code between applications, a new concept called assembly is introduced. Assemblies supports versioning.
  • Improved Security
  • Support Dynamic Web Pages – Using ASP.NET.
  • Support for Web Services
2) What is .Net Framework ?
The .NET framework is a programming framework from Microsoft. Developers can use .Net Framework to develop applications,install and run the application on Windows operating systems.

3) What is MS-IL (Microsoft Intermediate Language) ?

When a program is complied in .Net , the source code will be converted into an intermediate language called  Microsoft Intermediate Language (MS-IL) . This is done by Just-In time Compiler (JIT). .Net framework is built in such a way that , Code is Just-In time complied, that is it get complied when it is called rather compiling entire code at the start up. A portion of the code will get complied only once and it will exists till the application exit. This will have a significant improvement in performance since  entire section of the code wont get executed in most cases.

4) What is Common Language Runtime (CLR) ?
Common Language Runtime or CLR is the run-time execution environment of .Net Framework. Converting MS-IL into platform or OS specific code is done by CLR. Currently .Net programs will run only in windows.

5) What is Common Type System (CTS) ?

.Net uses Common Type System (CTS)  for Language Interoperability. CTS defines the predefined data types that are available in IL, so that all languages that target the .NET framework will produce compiled code that is ultimately based on these types. So that a data type defined in a VB.net will be understood by C#. For example, VB.Net uses  “Integer” to define data type Integer. C# uses  “int” to define data type Integer. When VB.Net code is complied , it will convert Integer to Int32 and since C# refers Int to Int32 VB.Net code will be understood by C#.

6) What is Common Language Specification (CLS) ?
Common Language Specification (CLS) is also used for Language Interoperability in tandem with CTS to ensure Language Interoperability. CLS defines a set of minimum standards that all compilers targeting .NET must support. For example VB.Net is not case sensitive. So attribute “EmployeeName” and “employeename” is considered same. But C# is case sensitive. So for language interoperability , C# doesn't allow two variable which differs only in Case.

7) What is Garbage Collector ?

Garbage Collector is used in .Net Framework for memory management. While running an application, application request for memory for its internal use. Framework allocates memory from the heap. Once the process is completed , allocated need to be reclaimed for future use. The process of reclaiming unused memory is taken care by Garbage Collector.

8) Which namespace is used for Asp.net MVC?
System.Web.Mvc namespace contains all the interfaces and classes which supports ASP.NET MVC framework for creating web applications.
 
9) Explain about "pagenLifecycle" a Asp.net MVC?
The page lifecycle of an ASP.NET MVC page is explained as follows:
i) App Initialisation
In this stage, the aplication starts up by running Global.asax’s Application_Start() method.
In this method, you can add Route objects to the static RouteTable.Routes collection.
If you’re implementing a custom IControllerFactory, you can set this as the active controller factory by assigning it to the System.Web.Mvc.ControllerFactory.Instance property.

ii) Routing
Routing is a stand-alone component that matches incoming requests to IHttpHandlers by URL pattern.
MvcHandler is, itself, an IHttpHandler, which acts as a kind of proxy to other IHttpHandlers configured in the Routes table.

iii) Instantiate and Execute Controller
At this stage, the active IControllerFactory supplies an IController instance.

iv) Locate and invoke controller action
At this stage, the controller invokes its relevant action method, which after further processing, calls RenderView().

v) Instantiate and render view
At this stage, the IViewFactory supplies an IView, which pushes response data to the IHttpResponse object
 
10) Explain about the formation of Router Table in Asp.netnMVC?
The Router Table is formed by following the below procedure:
In the begining stage, when the ASP.NET application starts, the method known as Application_Start() method is called.
The Application_Start() will then calls RegisterRoutes() method.
This RegisterRoutes() method will create the Router table.

11) Explain the advantages of using routing in Asp.Net MVC?
Without using Routing in an ASP.NET MVC application, the incoming browser request should be mapped to a physical file.The thing is that if the file is not there, then you will get a page not found error.
By using Routing, it will make use of URLs where there is no need of mapping to specific files in a web site.
This is because, for the URL, there is no need to map to a file, you can use URLs that are descriptive of the user's action and therefore are more easily understood by users.
 
12) State the differences between the Dispose() and Finalize().
CLR uses the Dispose and Finalize methods to perform garbage collection of run-time objects of .NET applications.
The Finalize method is called automatically by the runtime. CLR has a garbage collector (GC), which periodically checks for objects in heap that are no longer referenced by any object or program. It calls the Finalize method to free the memory used by such objects. The Dispose method is called by the programmer. Dispose is another method to release the memory used by an object. The Dispose method needs to be explicitly called in code to dereference an object from the heap. The Dispose method can be invoked only by the classes that implement the IDisposable interface.

13. What is code access security (CAS)?
Code access security (CAS) is part of the .NET security model that prevents unauthorized access of resources and operations, and restricts the code to perform particular tasks.
14. Differentiate between managed and unmanaged code?
Managed code is the code that is executed directly by the CLR instead of the operating system. The code compiler first compiles the managed code to intermediate language (IL) code, also called as MSIL code. This code doesn't depend on machine configurations and can be executed on different machines.
Unmanaged code is the code that is executed directly by the operating system outside the CLR environment. It is directly compiled to native machine code which depends on the machine configuration.
In the managed code, since the execution of the code is governed by CLR, the runtime provides different services, such as garbage collection, type checking, exception handling, and security support. These services help provide uniformity in platform and language-independent behavior of managed code applications. In the unmanaged code, the allocation of memory, type safety, and security is required to be taken care of by the developer. If the unmanaged code is not properly handled, it may result in memory leak. Examples of unmanaged code are ActiveX components and Win32 APIs that execute beyond the scope of native CLR.

15. What are tuples?
Tuple is a fixed-size collection that can have elements of either same or different data types. Similar to arrays, a user must have to specify the size of a tuple at the time of declaration. Tuples are allowed to hold up from 1 to 8 elements and if there are more than 8 elements, then the 8th element can be defined as another tuple. Tuples can be specified as parameter or return type of a method.

16. What are the improvements made in CAS in .NET 4.0?
The CAS mechanism in .NET is used to control and configure the ability of managed code. Earlier, as this policy was applicable for only native applications, the security guarantee was limited. Therefore, developers used to look for alternating solutions, such as operating system-level solutions. This problem was solved in .NET Framework 4 by turning off the machine-wide security. The shared and hosted Web applications can now run more securely. The security policy in .NET Framework 4 has been simplified using the transparency model. This model allows you to run the Web applications without concerning about the CAS policies.
As a result of security policy changes in .NET Framework 4.0, you may encounter compilation warnings and runtime exceptions, if your try to use the obsolete CAS policy types and members either implicitly or explicitly. However, you can avoid the warnings and errors by using the <NetFx40_LegacySecurityPolicy> configuration element in the runtime settings schema to opt into the obsolete CAS policy behavior.

17. What is Microsoft Intermediate Language (MSIL)?
The .NET Framework is shipped with compilers of all .NET programming languages to develop programs. There are separate compilers for the Visual Basic, C#, and Visual C++ programming languages in .NET Framework. Each .NET compiler produces an intermediate code after compiling the source code. The intermediate code is common for all languages and is understandable only to .NET environment. This intermediate code is known as MSIL.

18. What is lazy initialization?
Lazy initialization is a process by which an object is not initialized until it is first called in your code. The .NET 4.0 introduces a new wrapper class, System.Lazy<T>, for executing the lazy initialization in your application. Lazy initialization helps you to reduce the wastage of resources and memory requirements to improve performance. It also supports thread-safety.
19. How many types of generations are there in a garbage collector?
Memory management in the CLR is divided into three generations that are build up by grouping memory segments. Generations enhance the garbage collection performance. The following are the three types of generations found in a garbage collector:
  • Generation 0 - When an object is initialized, it is said to be in generation 0.
  • Generation 1 - The objects that are under garbage collection process are considered to be in generation 1.
  • Generation 2 - Whenever new objects are created and added to the memory, they are added to generation 0 and the old objects in generation 1 are considered to be in generation 2. 
20. What is the role of the JIT compiler in .NET Framework?
The JIT compiler is an important element of CLR, which loads MSIL on target machines for execution. The MSIL is stored in .NET assemblies after the developer has compiled the code written in any .NET-compliant programming language, such as Visual Basic and C#.

JIT compiler translates the MSIL code of an assembly and uses the CPU architecture of the target machine to execute a .NET application. It also stores the resulting native code so that it is accessible for subsequent calls. If a code executing on a target machine calls a non-native method, the JIT compiler converts the MSIL of that method into native code. JIT compiler also enforces type-safety in runtime environment of .NET Framework. It checks for the values that are passed to parameters of any method.

For example, the JIT compiler detects any event, if a user tries to assign a 32-bit value to a parameter that can only accept 8-bit value. 






Read More

C Interview Questions

1.  What is C language?
The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C is prized for its efficiency, and is the most popular programming language for writing system software, though it is also used for writing applications.

2.  What does static variable mean?
There are 3 main uses for the static.
1. If you declare within a function: It retains the value between function calls
2. If it is declared for a function name: By default function is extern..so it will be visible from other files if the function declaration is as static..it is invisible for the outer files 
3. Static for global variables: By default we can use the global variables from outside files If it is static global..that variable is limited to with in the file.
#include <stdio.h>
int t = 10; 
main(){
int x = 0;
void funct1();
funct1();           
printf("After first call \n");
funct1();           
printf("After second call \n");
funct1();           
printf("After third call \n");
}
void funct1()
{
    static int y = 0; 
    int z = 10;            
    printf("value of y %d z %d",y,z);
    y=y+10;

value of y 0 z 10 After first call
value of y 10 z 10 After second call
value of y 20 z 10 After third call


3.  What are the different storage classes in C?
C has three types of storage: automatic, static and allocated.  Variable having block scope and without static specifier have automatic storage duration. 
Variables with block scope, and with static specifier have static scope. Global variables (i.e, file scope) with or without the the static specifier also have static scope.  Memory obtained from calls to malloc(), alloc() or realloc() belongs to allocated storage class.

4.  What is hashing?
To hash means to grind up, and that’s essentially what hashing is all about. The heart of a hashing algorithm is a hash function that takes your nice, neat data and grinds it into some random-looking integer. 
The idea behind hashing is that some data either has no inherent ordering (such as images) or is expensive to compare (such as images). If the data has no inherent ordering, you can’t perform comparison searches. 

5.  Can static variables be declared in a header file?
You can’t declare a static variable without defining it as well (this is because the storage class modifiers static and extern are mutually exclusive). A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.

6.  Can a variable be both constant and volatile?
Yes. The const modifier means that this code cannot change the value of the variable, but that does not mean that the value cannot be changed by means outside this code. 
The function itself did not change the value of the timer, so it was declared const. However, the value was changed by hardware on the computer, so it was declared volatile. If a variable is both const and volatile, the two modifiers can appear in either order.

7.  Can include files be nested?
Yes. Include files can be nested any number of times. As long as you use precautionary measures, you can avoid including the same file twice. In the past, nesting header files was seen as bad programming practice, because it complicates the dependency tracking function of the MAKE program and thus slows down compilation. Many of today’s popular compilers make up for this difficulty by implementing a concept called precompiled headers, in which all headers and associated dependencies are stored in a precompiled state.

8.  What is a null pointer?
There are times when it’s necessary to have a pointer that doesn’t point to anything. The macro NULL, defined in , has a value that’s guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*.
Some people, notably C++ programmers, prefer to use 0 rather than NULL.
The null pointer is used in three ways:
1) To stop indirection in a recursive data structure.
2) As an error value.
3) As a sentinel value.


9.  What is the output of printf("%d") ?
When we write printf("%d",x); this means compiler will print the value of x. But as here, there is nothing after %d so compiler will show in output window garbage value.

10. What are different storage class specifiers in C? Ans: auto, register, static, extern

11. What is scope of a variable? How are variables scoped in C? Ans: Scope of a variable is the part of the program where the variable may directly be accessible. In C, all identifiers are lexically (or statically) scoped. See this for more details.

12. How will you print “Hello World” without semicolon? Ans:
int main(void)
{
if (printf(“Hello World”)) ;
}
[/sourcecode]


13. What is a file? Ans: A file is a region of storage in hard disks or in auxiliary storage devices.It contains bytes of
information .It is not a data type.


14. IMP>what are the types of file? Ans: Files are of two types
1-high level files (stream oriented files) :These files are accessed using library functions
2-low level files(system oriented files) :These files are accessed using system calls


15. IMP>what is a stream? Ans: A stream is a source of data or destination of data that may be associated with a disk or other
I/O device. The source stream provides data to a program and it is known as input stream. The destination stream eceives the output from the program and is known as output stream.


16. What is meant by file opening? Ans: The action of connecting a program to a file is called opening of a file. This requires creating
an I/O stream before reading or writing the data.


17. What is FILE? Ans: FILE is a predefined data type. It is defined in stdio.h file.

18.  What is the quickest sorting method to use?
The answer depends on what you mean by quickest. For most sorting problems, it just doesn’t matter how quick the sort is because it is done infrequently or other operations take significantly more time anyway. There are three sorting methods in this author’s toolbox that are all very fast and that are useful in different situations. Those methods are quick sort, merge sort, and radix sort.

19.  When should the volatile modifier be used?
The volatile modifier is a directive to the compiler’s optimizer that operations involving this variable should not be optimized in certain ways. There are two special cases in which use of the volatile modifier is desirable. The first case involves memory-mapped hardware (a device such as a graphics adaptor that appears to the computer’s hardware as if it were part of the computer’s memory), and the second involves shared memory (memory used by two or more programs running simultaneously).

20.  When should the register modifier be used?
The register modifier hints to the compiler that the variable will be heavily used and should be kept in the CPU’s registers, if possible, so that it can be accessed faster. 

21.  How can you determine the size of an allocated portion of memory?
You can’t, really. free() can , but there’s no way for your program to know the trick free() uses. Even if you disassemble the library and discover the trick, there’s no guarantee the trick won’t change with the next release of the compiler.

22.  When does the compiler not implicitly generate the address of the first element of an array?
Whenever an array name appears in an expression such as
·  array as an operand of the size of operator
·  array as an operand of & operator
·  array as a string literal initializer for a character array


Then the compiler does not implicitly generate the address of the address of the first element of an array.





Read More

About Me

Hello, I am Anamika here and working as HR consultant in Bangalore. I completed my MBA in HRM. My motto is creating this blog for those who need job and desperately looking for job change. I am humbly requesting to all visitor, please support me to make this blog to successful. Thanks :)