The #include directive is used to include header files that contain the declarations to the functions used in your C program. In other words, the #include directive tells the C preprocessor to look into the include path to find the specified header file.
Thursday, 22 March 2012
Why is the main() function needed in a C program?
The execution of a C program starts and ends with the main() function. Without the main() function, the computer does not know where to start to run a program.
What is the difference between the Heap and the Stack?
The main difference b/n the Heap and the Stack are given below:
- In stack we create object temporary where programmer used to reserve allocation.'
- stack not have automatic garbage collection where as heap have automatic garbage collection.
- In stack we create object temporary where programmer used to reserve allocation.'
- stack not have automatic garbage collection where as heap have automatic garbage collection.
Why n++ executes faster than n+1?
n++ executes faster than n+1 because n++ want only one instruction for execution where n+1 want more one instruction for execution.
How the processor registers can be used in C?
using keyword register we can use the process register in C. Basically process register is used to store variables those i want to access frequently. if these registers are not used in any other program, then those registers we used to allocate memory these variables.
What are the stream files in C?
We can open file in C with using stream files.which are identified with a pointer to a FILE structure, or as low-level files, which are identified with an integer handle.
We can open stream files with using one of the following functions.
fopen(): Opens the specified file with the specified mode
We can open stream files with using one of the following functions.
fopen(): Opens the specified file with the specified mode
freopen(): Closes the file specified, then opens a new file as specified
fdopen(): Opens a duplicate stream file for an already open low-lev
Is C is platform dependent or independent?
Major issue behind designing C language is that it is a small,portable programming language. It is used to implement an operating system.In past time C is a powerful tool for writing all types of program and has mechanism to achieve all most programming goals.So, we can say that C is platform dependent.
Famous Personalities who failed at first
Business Gurus
1. Henry FordFord is known for his innovative success but he failed five times before he founded the FORD Company.
2. R. H. Macy
Before the success of MACY, he failed in seven businesses and finally succeeded with his new store.
3. Soichiro Honda
The billion-dollar business, that is Honda, started initially with a series of failures. He started making scooters of his own at home and spurred on by his neighbors, finally started his own business.
4. Bill Gates
Gates didn't seem like a shoe-in for success after dropping out of Harvard and starting a failed first business with Microsoft co-founder Paul Allen called Traf-O-Data.
5. Harland David Sanders
Sanders founded KFC and his famous secret chicken recipe was rejected 1,009 times before a restaurant accepted it.
6. Walt Disney
Walt Disney had a bit of a rough start and he was fired by a newspaper editor because, 'he lacked imagination and had no good ideas'. He kept plugging along, however, and eventually found a recipe for success that worked.
Scientists
7. Albert Einstein8. Charles Darwin
9. Isaac Newton
10. Thomas Edison
11. Orville and Wilbur Wright
Public Figures
12. Winston ChurchillThis Nobel Prize-winning, twice-elected Prime Minster of the United Kingdom struggled in school and failed the sixth grade. After many years of political failures, finally became the Prime Minister at the ripe old age of 62.
13. Abraham Lincoln
After Lincoln was failed many times in business and defeated in numerous runs, he became a greatest leader.
14. Oprah Winfrey
Oprah faced a rough and abusive childhood as well as numerous career setbacks in her life to become one of the most iconic faces on TV.
Writers and Artists
15. Steven Spielberg16. J. K. Rowling
Athletes
17. Michael JordanMost people wouldn't believe that a man often lauded as the best basketball player of all time was actually cut from his high school basketball team. 'I have failed over and over and over again in my life. And that is why I succeed.'
Jsp Interview Questions-part4
What is the difference between ServletContext and PageContext?
ServletContext: Gives the information about the container and it represents an application. PageContext: Gives the information about the Request and it can provide all other implicit JSP objects .
Is there a way to reference the "this" variable within a JSP page?
Yes, there is. The page implicit object is equivalent to "this", and returns a reference to the generated servlet.
Can you make use of a ServletOutputStream object from within a JSP page?
Yes . By using getOutputStream() method on response implicit object we can get it.
What is the page directive is used to prevent a JSP page from automatically creating a session?
session object is by default available to the JSP. We can make it unavailable by using page directive as follows.
<%@ page session="false">
What's a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization?
Synchronized keyword is recommended to use to get thread-safety.
How does JSP handle run-time exceptions?
You can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing page.
For example:
<%@ page errorPage="error.jsp" %>
redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing. Within error.jsp, if you indicate that it is an error-processing page, via the directive:
<%@ page isErrorPage="true" %>
In the error pages we can access exception implicit object.
The JSP implicit objects
Implicit objects are by default available to the JSP. Being JSP author we can use these and not required to create it explicitly.
- request
- response
- pageContext
- session
- application
- out
- config
- page
- exception