Below are four questions covering around C basics

Dear Reader, Below are four questions covering around C basics.
Question 1
Can you explain the difference between data types and modifiers?
Answer :
Data types are the ones including int, float, char, double that determine the type and storage of the data within the variables. Whereas modifiers are used in conjunction with data types to precisely control the amount of storage to a variable of a particular data type. short, long etc are modifiers.
Question 2
Is it possible to precisely tell the size of short int in any machine?
Answer :
This depends upon the implementation. Guideline from ANSI C on the size of short int is that the size of short int should be lesser than or equal to than that of int.
Question 3
Does C have automatic garbage collection? What this can lead to?
Answer :
C does not have automatic garbage collection. In worst cases, this can lead to a memory leak. Memory leak occurs when dynamically allocated memory is not available for reuse.
Question 4
Tell a common mistake that programmers often do when using a new variable as counter for FOR loops? What could be a simple preventive measure?
Answer :
When using a new variable, some programmers tend to forget the initialization part. There could be several preventive measures. One measure could be that programmer can consider declaring two or three extra variables which can be used for future FOR loops as and when required.

Popular posts from this blog


HSC Exam Time Table 2013 Arts, Commerce, Science

What are cookies and its types? Where are cookies used?