<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6275908374119627509</id><updated>2012-03-03T08:48:05.988-08:00</updated><category term='C Programming'/><category term='C FAQs'/><title type='text'>C Programming Language- Step by step learning.</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-4836750546859266324</id><published>2009-09-04T03:27:00.001-07:00</published><updated>2009-09-04T03:27:35.047-07:00</updated><title type='text'>c Programming Question IV</title><content type='html'>Q1: Tell how to check whether a linked list is circular.&lt;br /&gt;&lt;br /&gt;A: Create two pointers, each set to the start of the list. Update each as follows:&lt;br /&gt;&lt;br /&gt;while (pointer1) {&lt;br /&gt;&lt;br /&gt; pointer1 = pointer1-&gt;next;&lt;br /&gt;&lt;br /&gt; pointer2 = pointer2-&gt;next; if (pointer2) pointer2=pointer2-&gt;next;&lt;br /&gt;&lt;br /&gt; if (pointer1 == pointer2) {&lt;br /&gt;&lt;br /&gt;print (\"circular\n\");&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q2: OK, why does this work?&lt;br /&gt;&lt;br /&gt;If a list is circular, at some point pointer2 will wrap around and be either at the item just before pointer1, or the item before that. Either way, it’s either 1 or 2 jumps until they meet.&lt;br /&gt;&lt;br /&gt;How can you quickly find the number of elements stored in a a) static array b) dynamic array ?&lt;br /&gt;&lt;br /&gt;Why is it difficult to store linked list in an array?&lt;br /&gt;&lt;br /&gt;How can you find the nodes with repetetive data in a linked list?&lt;br /&gt;&lt;br /&gt;Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable but aac or bcd are unacceptable.&lt;br /&gt;&lt;br /&gt;This is a C question that I had for an intern position at Microsoft: Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique. After I wrote out my function, he asked me to figure out from the code how many times the printf statement is run, and also questions on optimizing my algorithm.&lt;br /&gt;&lt;br /&gt;What’s the output of the following program? Why?&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;typedef union&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int a;&lt;br /&gt;&lt;br /&gt;char b[10];&lt;br /&gt;&lt;br /&gt;float c;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Union;&lt;br /&gt;&lt;br /&gt;Union x,y = {100};&lt;br /&gt;&lt;br /&gt;x.a = 50;&lt;br /&gt;&lt;br /&gt;strcpy(x.b,\"hello\");&lt;br /&gt;&lt;br /&gt;x.c = 21.50;&lt;br /&gt;&lt;br /&gt;printf(\"Union x : %d %s %f \n\",x.a,x.b,x.c );&lt;br /&gt;&lt;br /&gt;printf(\"Union y :%d %s%f \n\",y.a,y.b,y.c);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Given inputs X, Y, Z and operations | and &amp; (meaning bitwise OR and AND, respectively)&lt;br /&gt;&lt;br /&gt;What is output equal to in&lt;br /&gt;&lt;br /&gt;output = (X &amp; Y) | (X &amp; Z) | (Y &amp; Z)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-4836750546859266324?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/4836750546859266324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=4836750546859266324' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/4836750546859266324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/4836750546859266324'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2009/09/c-programming-question-iv.html' title='c Programming Question IV'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-1531249729516517439</id><published>2009-09-04T03:26:00.001-07:00</published><updated>2009-09-04T03:26:45.404-07:00</updated><title type='text'>c Programming Questions III</title><content type='html'>1. What will print out?&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;        char *p1=“name”;&lt;br /&gt;        char *p2;&lt;br /&gt;        p2=(char*)malloc(20);&lt;br /&gt;        memset (p2, 0, 20);&lt;br /&gt;        while(*p2++ = *p1++);&lt;br /&gt;        printf(“%s\n”,p2);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:empty string.&lt;br /&gt;&lt;br /&gt;   2. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    int x=20,y=35;&lt;br /&gt;    x=y++ + x++;&lt;br /&gt;    y= ++y + ++x;&lt;br /&gt;    printf(“%d%d\n”,x,y);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer : 5794&lt;br /&gt;&lt;br /&gt;   3. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    int x=5;&lt;br /&gt;    printf(“%d,%d,%d\n”,x,x&lt; &lt;2,x&gt;&gt;2);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: 5,20,1&lt;br /&gt;&lt;br /&gt;   4. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;#define swap(a,b) a=a+b;b=a-b;a=a-b;&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;    int x=5, y=10;&lt;br /&gt;    swap (x,y);&lt;br /&gt;    printf(“%d %d\n”,x,y);&lt;br /&gt;    swap2(x,y);&lt;br /&gt;    printf(“%d %d\n”,x,y);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int swap2(int a, int b)&lt;br /&gt;{&lt;br /&gt;    int temp;&lt;br /&gt;    temp=a;&lt;br /&gt;    b=a;&lt;br /&gt;    a=temp;&lt;br /&gt;    return 0;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: 10, 5&lt;br /&gt;10, 5&lt;br /&gt;&lt;br /&gt;   5. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    char *ptr = ” Cisco Systems”;&lt;br /&gt;    *ptr++; printf(“%s\n”,ptr);&lt;br /&gt;    ptr++;&lt;br /&gt;    printf(“%s\n”,ptr);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:Cisco Systems&lt;br /&gt;isco systems&lt;br /&gt;&lt;br /&gt;   6. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    char s1[]=“Cisco”;&lt;br /&gt;    char s2[]= “systems”;&lt;br /&gt;    printf(“%s”,s1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: Cisco&lt;br /&gt;&lt;br /&gt;   7. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    char *p1;&lt;br /&gt;    char *p2;&lt;br /&gt;&lt;br /&gt;    p1=(char *)malloc(25);&lt;br /&gt;    p2=(char *)malloc(25);&lt;br /&gt;&lt;br /&gt;    strcpy(p1,”Cisco”);&lt;br /&gt;    strcpy(p2,“systems”);&lt;br /&gt;    strcat(p1,p2);&lt;br /&gt;&lt;br /&gt;    printf(“%s”,p1);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: Ciscosystems&lt;br /&gt;&lt;br /&gt;   8. The following variable is available in file1.c, who can access it?:&lt;br /&gt;&lt;br /&gt;9.static int average;&lt;br /&gt;&lt;br /&gt;Answer: all the functions in the file1.c can access the variable.&lt;br /&gt;&lt;br /&gt;  10. WHat will be the result of the following code?&lt;br /&gt;&lt;br /&gt;#define TRUE 0 // some code&lt;br /&gt;&lt;br /&gt;while(TRUE)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    // some code&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: This will not go into the loop as TRUE is defined as 0.&lt;br /&gt;&lt;br /&gt;  11. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;int x;&lt;br /&gt;int modifyvalue()&lt;br /&gt;{&lt;br /&gt;    return(x+=10);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int changevalue(int x)&lt;br /&gt;{&lt;br /&gt;    return(x+=1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;    int x=10;&lt;br /&gt;    x++;&lt;br /&gt;    changevalue(x);&lt;br /&gt;    x++;&lt;br /&gt;    modifyvalue();&lt;br /&gt;    printf("First output:%d\n",x);&lt;br /&gt;&lt;br /&gt;    x++;&lt;br /&gt;    changevalue(x);&lt;br /&gt;    printf("Second output:%d\n",x);&lt;br /&gt;    modifyvalue();&lt;br /&gt;    printf("Third output:%d\n",x);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: 12 , 13 , 13&lt;br /&gt;&lt;br /&gt;  12. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    int x=10, y=15;&lt;br /&gt;    x = x++;&lt;br /&gt;    y = ++y;&lt;br /&gt;    printf(“%d %d\n”,x,y);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: 11, 16&lt;br /&gt;&lt;br /&gt;  13. What will be printed as the result of the operation below:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    int a=0;&lt;br /&gt;    if(a==0)&lt;br /&gt;        printf(“Cisco Systems\n”);&lt;br /&gt;        printf(“Cisco Systems\n”);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer: Two lines with “Cisco Systems” will be printed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-1531249729516517439?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/1531249729516517439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=1531249729516517439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/1531249729516517439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/1531249729516517439'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2009/09/c-programming-questions-iii.html' title='c Programming Questions III'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-139389961486808102</id><published>2009-09-04T03:25:00.000-07:00</published><updated>2009-09-04T03:26:08.701-07:00</updated><title type='text'>c Programming Questions II</title><content type='html'>1. What does static variable mean?&lt;br /&gt;   2. What is a pointer?&lt;br /&gt;   3. What is a structure?&lt;br /&gt;   4. What are the differences between structures and arrays?&lt;br /&gt;   5. In header files whether functions are declared or defined?&lt;br /&gt;   6. What are the differences between malloc() and calloc()?&lt;br /&gt;   7. Difference between pass by reference and pass by value?&lt;br /&gt;   8. What is stat&lt;br /&gt;   9. What are macros? What are the advantages and disadvantages?&lt;br /&gt;  10. ic identifier?&lt;br /&gt;  11. Where are the auto variables stored?&lt;br /&gt;  12. Where does global, static, local, register variables, free memory and C Program instructions get stored?&lt;br /&gt;  13. Difference between arrays and linked list?&lt;br /&gt;  14. What are enumerations?&lt;br /&gt;  15. Describe about storage allocation and scope of global, extern, static, local and register variables?&lt;br /&gt;  16. What are register variables? What are the advantage of using register variables?&lt;br /&gt;  17. What is the use of typedef?&lt;br /&gt;  18. Can we specify variable field width in a scanf() format string? If possible how?&lt;br /&gt;  19. Out of fgets() and gets() which function is safe to use and why?&lt;br /&gt;  20. Difference between strdup and strcpy? &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# What is recursion?&lt;br /&gt;# Differentiate between a for loop and a while loop? What are it uses?&lt;br /&gt;# What are the different storage classes in C?&lt;br /&gt;# Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?&lt;br /&gt;# What is difference between Structure and Unions?&lt;br /&gt;# What the advantages of using Unions?&lt;br /&gt;# What are the advantages of using pointers in a program?&lt;br /&gt;# What is the difference between Strings and Arrays?&lt;br /&gt;# In a header file whether functions are declared or defined?&lt;br /&gt;# What is a far pointer? where we use it?&lt;br /&gt;# How will you declare an array of three function pointers where each function receives two ints and returns a float?&lt;br /&gt;# What is a NULL Pointer? Whether it is same as an uninitialized pointer?&lt;br /&gt;# What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?&lt;br /&gt;# What does the error ‘Null Pointer Assignment’ mean and what causes this error?&lt;br /&gt;# What is near, far and huge pointers? How many bytes are occupied by them?&lt;br /&gt;# How would you obtain segment and offset addresses from a far address of a memory location?&lt;br /&gt;# Are the expressions arr and *arr same for an array of integers?&lt;br /&gt;# Does mentioning the array name gives the base address in all the contexts?&lt;br /&gt;# Explain one method to process an entire string as one unit?&lt;br /&gt;# What is the similarity between a Structure, Union and enumeration?&lt;br /&gt;# Can a Structure contain a Pointer to itself?&lt;br /&gt;# How can we check whether the contents of two structure variables are same or not?&lt;br /&gt;# How are Structure passing and returning implemented by the complier?&lt;br /&gt;# How can we read/write Structures from/to data files?&lt;br /&gt;# What is the difference between an enumeration and a set of pre-processor # defines?&lt;br /&gt;# What do the ‘c’ and ‘v’ in argc and argv stand for?&lt;br /&gt;# Are the variables argc and argv are local to main?&lt;br /&gt;# What is the maximum combined length of command line arguments including the space between adjacent arguments?&lt;br /&gt;# If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?&lt;br /&gt;# Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?&lt;br /&gt;# What are bit fields? What is the use of bit fields in a Structure declaration?&lt;br /&gt;# To which numbering system can the binary number 1101100100111100 be easily converted to?&lt;br /&gt;# Which bit wise operator is suitable for checking whether a particular bit is on or off?&lt;br /&gt;# Which bit wise operator is suitable for turning off a particular bit in a number?&lt;br /&gt;# Which bit wise operator is suitable for putting on a particular bit in a number?&lt;br /&gt;# Which bit wise operator is suitable for checking whether a particular bit is on or off?&lt;br /&gt;# Which one is equivalent to multiplying by 2?&lt;br /&gt;&lt;br /&gt;    * Left shifting a number by 1&lt;br /&gt;    * Left shifting an unsigned int or char by 1? &lt;br /&gt;&lt;br /&gt;# Write a program to compare two strings without using the strcmp() function.&lt;br /&gt;# Write a program to concatenate two strings.&lt;br /&gt;# Write a program to interchange 2 variables without using the third one.&lt;br /&gt;# Write programs for String Reversal. The same for Palindrome check.&lt;br /&gt;# Write a program to find the Factorial of a number.&lt;br /&gt;# Write a program to generate the Fibonacci Series?&lt;br /&gt;# Write a program which employs Recursion?&lt;br /&gt;# Write a program which uses command line arguments.&lt;br /&gt;# Write a program which uses functions like strcmp(), strcpy(), etc.&lt;br /&gt;# What are the advantages of using typedef in a program?&lt;br /&gt;# How would you dynamically allocate a one-dimensional and two-dimensional array of integers?&lt;br /&gt;# How can you increase the size of a dynamically allocated array?&lt;br /&gt;# How can you increase the size of a statically allocated array?&lt;br /&gt;# When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?&lt;br /&gt;# Which function should be used to free the memory allocated by calloc()?&lt;br /&gt;# How much maximum can you allocate in a single call to malloc()?&lt;br /&gt;# Can you dynamically allocate arrays in expanded memory?&lt;br /&gt;# What is object file? How can you access object file?&lt;br /&gt;# Which header file should you include if you are to develop a function which can accept variable number of arguments?&lt;br /&gt;# Can you write a function similar to printf()?&lt;br /&gt;# How can a called function determine the number of arguments that have been passed to it?&lt;br /&gt;# Can there be at least some solution to determine the number of arguments passed to a variable argument list function?&lt;br /&gt;# How do you declare the following:&lt;br /&gt;&lt;br /&gt;    * An array of three pointers to chars&lt;br /&gt;    * An array of three char pointers&lt;br /&gt;    * A pointer to array of three chars&lt;br /&gt;    * A pointer to function which receives an int pointer and returns a float pointer&lt;br /&gt;    * A pointer to a function which receives nothing and returns nothing &lt;br /&gt;&lt;br /&gt;# What do the functions atoi(), itoa() and gcvt() do?&lt;br /&gt;# Does there exist any other function which can be used to convert an integer or a float to a string?&lt;br /&gt;# How would you use qsort() function to sort an array of structures?&lt;br /&gt;# How would you use qsort() function to sort the name stored in an array of pointers to string?&lt;br /&gt;# How would you use bsearch() function to search a name stored in array of pointers to string?&lt;br /&gt;# How would you use the functions sin(), pow(), sqrt()?&lt;br /&gt;# How would you use the functions memcpy(), memset(), memmove()?&lt;br /&gt;# How would you use the functions fseek(), freed(), fwrite() and ftell()?&lt;br /&gt;# How would you obtain the current time and difference between two times?&lt;br /&gt;# How would you use the functions randomize() and random()?&lt;br /&gt;# How would you implement a substr() function that extracts a sub string from a given string?&lt;br /&gt;# What is the difference between the functions rand(), random(), srand() and randomize()?&lt;br /&gt;# What is the difference between the functions memmove() and memcpy()?&lt;br /&gt;# How do you print a string on the printer?&lt;br /&gt;# Can you use the function fprintf() to display the output on the screen?&lt;br /&gt;# Gautam Pagedar adds this question: What is a linklist and why do we use it when we have arrays? - I feel the correct answer should be linklist is used in cases where you don’t know the memory required to store a data structure and need to allocate is dynamically on demand.&lt;br /&gt;# How do you detect a loop in linked list?&lt;br /&gt;# Sunil asks: What is the difference between main() in C and main() in C++?&lt;br /&gt;# ajz at his interviews asks what will be printed out when the following code is executed:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;printf("%x",-1&lt;&lt;4);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-139389961486808102?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/139389961486808102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=139389961486808102' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/139389961486808102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/139389961486808102'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2009/09/c-programming-questions-ii.html' title='c Programming Questions II'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-47181496885210364</id><published>2009-09-04T03:24:00.000-07:00</published><updated>2009-09-04T03:25:50.665-07:00</updated><title type='text'>C Programming questions I</title><content type='html'>&lt;br /&gt;2. For the following C program&lt;br /&gt;&lt;br /&gt;#define AREA(x)(3.14*x*x)&lt;br /&gt;main()&lt;br /&gt;{float r1=6.25,r2=2.5,a;&lt;br /&gt;a=AREA(r1);&lt;br /&gt;printf("\n Area of the circle is %f", a);&lt;br /&gt;a=AREA(r2);&lt;br /&gt;printf("\n Area of the circle is %f", a);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;What is the output?&lt;br /&gt;&lt;br /&gt;3.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int d=5;&lt;br /&gt;printf("%f",d);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;for(i=1;i&lt;4,i++)&lt;br /&gt;switch(i)&lt;br /&gt;case 1: printf("%d",i);break;&lt;br /&gt;{&lt;br /&gt;case 2:printf("%d",i);break;&lt;br /&gt;case 3:printf("%d",i);break;&lt;br /&gt;}&lt;br /&gt;switch(i) case 4:printf("%d",i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;char *s="\12345s\n";&lt;br /&gt;printf("%d",sizeof(s));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;unsigned i=1; /* unsigned char k= -1 =&gt; k=255; */&lt;br /&gt;signed j=-1; /* char k= -1 =&gt; k=65535 */&lt;br /&gt;/* unsigned or signed int k= -1 =&gt;k=65535 */&lt;br /&gt;if(i&lt;j)&lt;br /&gt;printf("less");&lt;br /&gt;else&lt;br /&gt;if(i&gt;j)&lt;br /&gt;printf("greater");&lt;br /&gt;else&lt;br /&gt;if(i==j)&lt;br /&gt;printf("equal");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;float j;&lt;br /&gt;j=1000*1000;&lt;br /&gt;printf("%f",j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;1. 1000000&lt;br /&gt;2. Overflow&lt;br /&gt;3. Error&lt;br /&gt;4. None&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8.  How do you declare an array of N pointers to functions returning&lt;br /&gt;     pointers to functions returning pointers to characters?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9.&lt;br /&gt;int f()&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;f(1);&lt;br /&gt;f(1,2);&lt;br /&gt;f(1,2,3);&lt;br /&gt;}&lt;br /&gt;f(int i,int j,int k)&lt;br /&gt;{&lt;br /&gt;printf("%d %d %d",i,j,k);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;What are the number of syntax errors in the above?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i=7;&lt;br /&gt;printf("%d",i++*i++);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;11.&lt;br /&gt;#define one 0&lt;br /&gt;#ifdef one&lt;br /&gt;printf("one is defined ");&lt;br /&gt;#ifndef one&lt;br /&gt;printf("one is not defined ");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;12.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int count=10,*temp,sum=0;&lt;br /&gt;temp=&amp;count;&lt;br /&gt;*temp=20;&lt;br /&gt;temp=&amp;sum;&lt;br /&gt;*temp=count;&lt;br /&gt;printf("%d %d %d ",count,*temp,sum);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;13. what is alloca()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;14.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;static i=3;&lt;br /&gt;printf("%d",i--);&lt;br /&gt;return i&gt;0 ? main():0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;15.&lt;br /&gt;char *foo()&lt;br /&gt;{&lt;br /&gt;char result[100]);&lt;br /&gt;strcpy(result,"anything is good");&lt;br /&gt;return(result);&lt;br /&gt;}&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;char *j;&lt;br /&gt;j=foo()&lt;br /&gt;printf("%s",j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;16.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;char *s[]={ "dharma","hewlett-packard","siemens","ibm"};&lt;br /&gt;char **p;&lt;br /&gt;p=s;&lt;br /&gt;printf("%s",++*p);&lt;br /&gt;printf("%s",*p++);&lt;br /&gt;printf("%s",++*p);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;17. Output of the following program is&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{int i=0;&lt;br /&gt;for(i=0;i&lt;20;i++)&lt;br /&gt;{switch(i)&lt;br /&gt;case 0:i+=5;&lt;br /&gt;case 1:i+=2;&lt;br /&gt;case 5:i+=5;&lt;br /&gt;default i+=4;&lt;br /&gt;break;}&lt;br /&gt;printf("%d,",i);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) 0,5,9,13,17&lt;br /&gt;b) 5,9,13,17&lt;br /&gt;c) 12,17,22&lt;br /&gt;d) 16,21&lt;br /&gt;e) Syntax error&lt;br /&gt;&lt;br /&gt;18. What is the ouptut in the following program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{char c=-64;&lt;br /&gt;int i=-32&lt;br /&gt;unsigned int u =-16;&lt;br /&gt;if(c&gt;i)&lt;br /&gt;{printf("pass1,");&lt;br /&gt;if(c&lt;u)&lt;br /&gt;printf("pass2");&lt;br /&gt;else&lt;br /&gt;printf("Fail2");&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;printf("Fail1);&lt;br /&gt;if(i&lt;u)&lt;br /&gt;printf("pass2");&lt;br /&gt;else&lt;br /&gt;printf("Fail2")&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) Pass1,Pass2&lt;br /&gt;b) Pass1,Fail2&lt;br /&gt;c) Fail1,Pass2&lt;br /&gt;d) Fail1,Fail2&lt;br /&gt;e) None of these&lt;br /&gt;&lt;br /&gt;19. What will the following program do?&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;char a[]="String";&lt;br /&gt;char *p="New Sring";&lt;br /&gt;char *Temp;&lt;br /&gt;Temp=a;&lt;br /&gt;a=malloc(strlen(p) + 1);&lt;br /&gt;strcpy(a,p); //Line number:9//&lt;br /&gt;p = malloc(strlen(Temp) + 1);&lt;br /&gt;strcpy(p,Temp);&lt;br /&gt;printf("(%s, %s)",a,p);&lt;br /&gt;free(p);&lt;br /&gt;free(a);&lt;br /&gt;} //Line number 15//&lt;br /&gt;&lt;br /&gt;a) Swap contents of p &amp; a and print:(New string, string)&lt;br /&gt;b) Generate compilation error in line number 8&lt;br /&gt;c) Generate compilation error in line number 5&lt;br /&gt;d) Generate compilation error in line number 7&lt;br /&gt;e) Generate compilation error in line number 1&lt;br /&gt;&lt;br /&gt;20. In the following code segment what will be the result of the function,&lt;br /&gt;&lt;br /&gt;value of x , value of y&lt;br /&gt;{unsigned int x=-1;&lt;br /&gt;int y;&lt;br /&gt;y = ~0;&lt;br /&gt;if(x == y)&lt;br /&gt;printf("same");&lt;br /&gt;else&lt;br /&gt;printf("not same");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) same, MAXINT, -1&lt;br /&gt;b) not same, MAXINT, -MAXINT&lt;br /&gt;c) same , MAXUNIT, -1&lt;br /&gt;d) same, MAXUNIT, MAXUNIT&lt;br /&gt;e) not same, MAXINT, MAXUNIT&lt;br /&gt;&lt;br /&gt;21. What will be the result of the following program ?&lt;br /&gt;&lt;br /&gt;char *gxxx()&lt;br /&gt;{static char xxx[1024];&lt;br /&gt;return xxx;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{char *g="string";&lt;br /&gt;strcpy(gxxx(),g);&lt;br /&gt;g = gxxx();&lt;br /&gt;strcpy(g,"oldstring");&lt;br /&gt;printf("The string is : %s",gxxx());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) The string is : string&lt;br /&gt;b) The string is :Oldstring&lt;br /&gt;c) Run time error/Core dump&lt;br /&gt;d) Syntax error during compilation&lt;br /&gt;e) None of these&lt;br /&gt;&lt;br /&gt;22.Find the output for the following C program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p1="Name";&lt;br /&gt;char *p2;&lt;br /&gt;p2=(char *)malloc(20);&lt;br /&gt;while(*p2++=*p1++);&lt;br /&gt;printf("%s\n",p2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;23.Find the output for the following C program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x=20,y=35;&lt;br /&gt;x = y++ + x++;&lt;br /&gt;y = ++y + ++x;&lt;br /&gt;printf("%d %d\n",x,y);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;24.Find the output for the following C program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x=5;&lt;br /&gt;printf("%d %d %d\n",x,x&lt;&lt;2,x&gt;&gt;2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;25 Find the output for the following C program&lt;br /&gt;&lt;br /&gt;#define swap1(a,b) a=a+b;b=a-b;a=a-b;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x=5,y=10;&lt;br /&gt;swap1(x,y);&lt;br /&gt;printf("%d %d\n",x,y);&lt;br /&gt;swap2(x,y);&lt;br /&gt;printf("%d %d\n",x,y);&lt;br /&gt;}&lt;br /&gt;int swap2(int a,int b)&lt;br /&gt;{&lt;br /&gt;int temp;&lt;br /&gt;temp=a;&lt;br /&gt;b=a;&lt;br /&gt;a=temp;&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;26 Find the output for the following C program&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *ptr = "Ramco Systems";&lt;br /&gt;(*ptr)++;&lt;br /&gt;printf("%s\n",ptr);&lt;br /&gt;ptr++;&lt;br /&gt;printf("%s\n",ptr);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;27 Find the output for the following C program&lt;br /&gt;&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p1;&lt;br /&gt;char *p2;&lt;br /&gt;p1=(char *) malloc(25);&lt;br /&gt;p2=(char *) malloc(25);&lt;br /&gt;strcpy(p1,"Ramco");&lt;br /&gt;strcpy(p2,"Systems");&lt;br /&gt;strcat(p1,p2);&lt;br /&gt;printf("%s",p1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;28.Find the output for the following C program&lt;br /&gt;&lt;br /&gt;# define TRUE 0&lt;br /&gt;some code&lt;br /&gt;while(TRUE)&lt;br /&gt;{&lt;br /&gt;some code&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;29. struct list{&lt;br /&gt;       int x;&lt;br /&gt;      struct list *next;&lt;br /&gt;      }*head;&lt;br /&gt;&lt;br /&gt;        the struct head.x =100&lt;br /&gt;&lt;br /&gt;       Is the above assignment to pointer is correct or wrong ?&lt;br /&gt;&lt;br /&gt;30.What is the output of the following ?&lt;br /&gt;&lt;br /&gt;      int i;&lt;br /&gt;      i=1;&lt;br /&gt;      i=i+2*i++;&lt;br /&gt;      printf(%d,i);&lt;br /&gt;&lt;br /&gt;31. FILE *fp1,*fp2;&lt;br /&gt;&lt;br /&gt;      fp1=fopen("one","w")&lt;br /&gt;      fp2=fopen("one","w")&lt;br /&gt;      fputc('A',fp1)&lt;br /&gt;      fputc('B',fp2)&lt;br /&gt;      fclose(fp1)&lt;br /&gt;      fclose(fp2)&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     Find the Error, If Any?&lt;br /&gt;&lt;br /&gt;32. #define MAN(x,y) (x)&gt;(y)?(x):(y)&lt;br /&gt;      {int i=10;&lt;br /&gt;      j=5;&lt;br /&gt;      k=0;&lt;br /&gt;      k=MAX(i++,++j);&lt;br /&gt;      printf(%d %d %d %d,i,j,k);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;33.void main()&lt;br /&gt;{&lt;br /&gt;int i=7;&lt;br /&gt;printf("%d",i++*i++);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;34.How will u terminate the statement?&lt;br /&gt;&lt;br /&gt;35.select the wrong one&lt;br /&gt;a.a+=1;&lt;br /&gt;b.a*=2;&lt;br /&gt;c.a**=1;&lt;br /&gt;d.a&gt;&gt;=1;&lt;br /&gt;&lt;br /&gt;36.pick the odd one&lt;br /&gt;a.malloc&lt;br /&gt;b.calloc&lt;br /&gt;c.new&lt;br /&gt;&lt;br /&gt;37.main()&lt;br /&gt;{&lt;br /&gt;char **p=="Hello";&lt;br /&gt;printf("%s",**p);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;38.main()&lt;br /&gt;{&lt;br /&gt;printf("%d%c\n");&lt;br /&gt;printf("%d%c\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;39.main()&lt;br /&gt;{&lt;br /&gt;int x==5;&lt;br /&gt;printf("%d%d",x++,++x);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;40.main()&lt;br /&gt;{&lt;br /&gt;int x==4;&lt;br /&gt;printf("%d",printf(" %d %d ",x,x) );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;41.main()&lt;br /&gt;{&lt;br /&gt;union&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;char p;&lt;br /&gt;struct&lt;br /&gt;{&lt;br /&gt;int t;&lt;br /&gt;char e;&lt;br /&gt;char o;&lt;br /&gt;};&lt;br /&gt;};&lt;br /&gt;printf("%d\n",sizeof(l) );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;42.main()&lt;br /&gt;{&lt;br /&gt;int i==0,n==6;&lt;br /&gt;while(n--0);&lt;br /&gt;i+==n;&lt;br /&gt;printf("%d\n",i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Answers &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;1.        B&lt;br /&gt;&lt;br /&gt;2.        Area of the circle is 122.656250&lt;br /&gt; Area of the circle is  19.625000&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;3.        Undefined&lt;br /&gt;&lt;br /&gt;4.        1,2,3,4&lt;br /&gt;&lt;br /&gt;5.        6&lt;br /&gt;&lt;br /&gt;6.        less&lt;br /&gt;&lt;br /&gt;7.        4&lt;br /&gt;&lt;br /&gt;8.       char *(*(*a[N])())();&lt;br /&gt;&lt;br /&gt;9.        None.&lt;br /&gt;&lt;br /&gt;10.     56&lt;br /&gt;&lt;br /&gt;11.     "one is defined"&lt;br /&gt;&lt;br /&gt;12.     20 20 20&lt;br /&gt;&lt;br /&gt;13.    It allocates and frees memory after use/after getting out of scope&lt;br /&gt;&lt;br /&gt;14.     321&lt;br /&gt;&lt;br /&gt;15.    anything is good.&lt;br /&gt;&lt;br /&gt;16.    "harma" (p-&gt;add(dharma) &amp;&amp; (*p)-&gt;harma)&lt;br /&gt;"harma" (after printing, p-&gt;add(hewlett-packard) &amp;&amp;(*p)-&gt;harma)&lt;br /&gt;"ewlett-packard"&lt;br /&gt;&lt;br /&gt;17.     (d)&lt;br /&gt;&lt;br /&gt;18.     (c)&lt;br /&gt;&lt;br /&gt;19.     (b)&lt;br /&gt;&lt;br /&gt;20.     (a)&lt;br /&gt;&lt;br /&gt;21.     (b)&lt;br /&gt;&lt;br /&gt;22.     An empty string&lt;br /&gt;&lt;br /&gt;23.     57 94&lt;br /&gt;&lt;br /&gt;24.     5 20 1&lt;br /&gt;&lt;br /&gt;25.     10 5&lt;br /&gt;&lt;br /&gt;26.     Samco Systems&lt;br /&gt;&lt;br /&gt;27.     RamcoSystems&lt;br /&gt;&lt;br /&gt;28.    This won't go into the loop as TRUE is defined as 0&lt;br /&gt;&lt;br /&gt;29.     Wrong&lt;br /&gt;&lt;br /&gt;30.     4&lt;br /&gt;&lt;br /&gt;31.    no error. But It will over writes on same file.&lt;br /&gt;&lt;br /&gt;32.    10 5 0&lt;br /&gt;&lt;br /&gt;33.     56&lt;br /&gt;&lt;br /&gt;34.     ;&lt;br /&gt;&lt;br /&gt;35.    C&lt;br /&gt;&lt;br /&gt;36.    C&lt;br /&gt;&lt;br /&gt;37.     Garbage or nothing&lt;br /&gt;&lt;br /&gt;38.     Garbage Value&lt;br /&gt;&lt;br /&gt;39.    6 6&lt;br /&gt;&lt;br /&gt;40.     4 4 5&lt;br /&gt;&lt;br /&gt;41.     4&lt;br /&gt;&lt;br /&gt;42.     -1&lt;br /&gt;&lt;br /&gt;43.     0&lt;br /&gt;&lt;br /&gt;44.     3&lt;br /&gt;&lt;br /&gt;45.     16 21&lt;br /&gt;&lt;br /&gt;46.    UPPER CASE&lt;br /&gt;&lt;br /&gt;47.     5 4 3 2 1&lt;br /&gt;&lt;br /&gt;48.     (newdictionary)-(dictionarynew)&lt;br /&gt;&lt;br /&gt;49.     (newdictionary)-(dictionarynew)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;50.     50&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;C Questions Page 1(New)&lt;br /&gt;&lt;br /&gt;C Questions Page 2&lt;br /&gt;&lt;br /&gt;C Questions Page 3&lt;br /&gt;&lt;br /&gt;C Questions Page 4&lt;br /&gt;&lt;br /&gt;C Problems&lt;br /&gt;Visual C++  Projects&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-47181496885210364?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/47181496885210364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=47181496885210364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/47181496885210364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/47181496885210364'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2009/09/c-programming-questions-i.html' title='C Programming questions I'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-125284353446151560</id><published>2008-12-11T07:06:00.001-08:00</published><updated>2009-01-03T01:14:59.092-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Passing Command line arguments</title><content type='html'>If you are working in a command line environment such as UNIX, Linux, or the DOS&lt;br /&gt;prompt, it might be helpful to write programs that take arguments from the command&lt;br /&gt;line. For example, suppose we have a program called sum, which takes two numbers as&lt;br /&gt;command line arguments and displays their sum. We could enter the following command&lt;br /&gt;at the operating system prompt:&lt;br /&gt;sum 12 16&lt;br /&gt;&lt;br /&gt;The arguments, which are separated by a space, are 12 and 16. Because a C++ program&lt;br /&gt;starts its execution with function main, command line arguments are passed to main. Function&lt;br /&gt;main can be optionally written with two special parameters. These parameters are&lt;br /&gt;traditionally named argc and argv . The argc parameter is an int, and the argv parameter is an array of char pointers. Here is an example function header for main , using these two Parameters:&lt;br /&gt;&lt;br /&gt;int main(int argc, char *argv[])&lt;br /&gt;&lt;br /&gt;The argc parameter contains the number of items that were typed on the command line,&lt;br /&gt;including the name of the program. For example, if the sum program described above is&lt;br /&gt;executed with the command&lt;br /&gt;sum 12 16,&lt;br /&gt;&lt;br /&gt;the argc parameter will contain 3. As previously mentioned, the argv parameter is an array of char pointers. In the function header, the brackets are empty because argv is an external array of unknown size. The number that is stored in argc , however, will be the number of elements in the argv array.Each pointer in the argv array points to a C-string holding a command line argument. Once again, assume the sum program is executed with the command&lt;br /&gt;sum 12 16.&lt;br /&gt;&lt;br /&gt;The elements of the argv array will reference the items on the command line in the following&lt;br /&gt;manner:&lt;br /&gt;argv[0] = "sum"&lt;br /&gt;argv[1] = "12"&lt;br /&gt;argv[2] = "16"&lt;br /&gt;Before we look at the code for the sum program, let’s look at Program H-1. It is a simple&lt;br /&gt;program that simply displays its command line arguments. (The program is named argdemo.cpp. )&lt;br /&gt;&lt;br /&gt;Appendix H: Passing Command Line Arguments Now, let’s look at the code for the sum program.&lt;br /&gt;Program H-1 (argdemo.cpp)&lt;br /&gt;1 // This program demonstrates how to read&lt;br /&gt;2 // command line arguments.&lt;br /&gt;3 #include &lt;iostream&gt;&lt;br /&gt;4 using namespace std;&lt;br /&gt;5&lt;br /&gt;6 int main(int argc, char *argv[])&lt;br /&gt;7 {&lt;br /&gt;8 cout &lt;&lt; "You entered " &lt;&lt; (argc - 1); 9 cout &lt;&lt; " command line arguments.\n"; 10 if (argc &gt; 1)&lt;br /&gt;11 {&lt;br /&gt;12 cout &lt;&lt; "Here they are:\n"; 13 for (int count = 1; count &lt;&gt;&lt;br /&gt;4 #include &lt;cmath&gt; // Needed for atof&lt;br /&gt;5 using namespace std;&lt;br /&gt;6&lt;br /&gt;7 int main(int argc, char *argv[])&lt;br /&gt;8 {&lt;br /&gt;9 double total = 0;&lt;br /&gt;10&lt;br /&gt;11 if (argc &gt; 1)&lt;br /&gt;12 {&lt;br /&gt;13 for (int count = 1; count &lt; argc; count++)&lt;br /&gt;14 total += atof(argv[count]);&lt;br /&gt;15 cout &lt;&lt; total &lt;&lt; endl;&lt;br /&gt;16 }&lt;br /&gt;17 return 0;&lt;br /&gt;18 }&lt;br /&gt;Example Session on a UNIX System&lt;br /&gt;$ sum 12 16&lt;br /&gt;[Enter]&lt;br /&gt;28&lt;br /&gt;$ sum 1 2 3 4 5&lt;br /&gt;[Enter]&lt;br /&gt;15&lt;br /&gt;$&lt;/cmath&gt;&lt;/iostream&gt;&lt;/iostream&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-125284353446151560?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/125284353446151560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=125284353446151560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/125284353446151560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/125284353446151560'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/12/passing-command-line-arguments.html' title='Passing Command line arguments'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-4326615451077211881</id><published>2008-11-26T06:00:00.000-08:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>C- Questions</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CUsers%5Csujata%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CUsers%5Csujata%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Csujata%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-IN&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="0" name="header"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-ansi-language:EN-US; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:612.0pt 792.0pt; 	margin:72.0pt 90.0pt 72.0pt 90.0pt; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1060010362; 	mso-list-template-ids:118894384;} @list l0:level1 	{mso-level-tab-stop:36.0pt; 	mso-level-number-position:left; 	text-indent:-18.0pt;} @list l0:level2 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:72.0pt; 	mso-level-number-position:left; 	text-indent:-18.0pt; 	mso-ansi-font-size:10.0pt; 	font-family:"Courier New"; 	mso-bidi-font-family:"Times New Roman";} ol 	{margin-bottom:0cm;} ul 	{margin-bottom:0cm;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;table class="MsoNormalTable" style="width: 100%;" border="0" cellpadding="0" width="100%"&gt;  &lt;tbody&gt;&lt;tr style="height: 12pt;"&gt;   &lt;td style="padding: 0.75pt; width: 59%; height: 12pt;" width="59%"&gt;   &lt;p class="MsoNormal" style="line-height: 14.4pt;"&gt;&lt;a name="cq"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: red; text-transform: uppercase;" lang="EN-US"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(0, 51, 153); text-transform: uppercase;" lang="EN-US"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black; text-transform: uppercase;" lang="EN-US"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      does static variable mean? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is a pointer? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is a structure? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are the differences between structures and arrays? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;In      header files whether functions are declared or defined?  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are the differences between malloc() and calloc()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are macros? what are its advantages and disadvantages? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Difference      between pass by reference and pass by value? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is static identifier? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Where      are the auto variables stored? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Where      does global, static, local, register variables, free memory and C Program      instructions get stored? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Difference      between arrays and linked list? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are enumerations? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Describe      about storage allocation and scope of global, extern, static, local and      register variables? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are register variables? What are the advantage of using register      variables? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the use of typedef? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Can      we specify variable field width in a scanf() format string? If possible      how? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Out      of fgets() and gets() which function is safe to use and why? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Difference      between strdup and strcpy? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is recursion? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Differentiate      between a for loop and a while loop? What are it uses? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are the different storage classes in C? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      down the equivalent pointer __expression for referring the same element      a[i][j][k][l]? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is difference between Structure and Unions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      the advantages of using Unions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are the advantages of using pointers in a program? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the difference between Strings and Arrays? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;In a      header file whether functions are declared or defined? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is a far pointer? where we use it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      will you declare an array of three function pointers where each function      receives two ints and returns a float? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;what      is a NULL Pointer? Whether it is same as an uninitialized pointer? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is a NULL Macro? What is the difference between a NULL Pointer and a NULL      Macro? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      does the error 'Null Pointer Assignment' mean and what causes this error? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is near, far and huge pointers? How many bytes are occupied by them? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you obtain segment and offset addresses from a far address of a      memory location? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Are      the expressions arr and &amp;amp;arr same for an array of integers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Does      mentioning the array name gives the base address in all the contexts? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Explain      one method to process an entire string as one unit? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the similarity between a Structure, Union and enumeration? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Can a      Structure contain a Pointer to itself? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      can we check whether the contents of two structure variables are same or      not? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      are Structure passing and returning implemented by the complier? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      can we read/write Structures from/to data files? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the difference between an enumeration and a set of pre-processor #      defines? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;what      do the 'c' and 'v' in argc and argv stand for? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Are      the variables argc and argv are local to main? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the maximum combined length of command line arguments including the      space between adjacent arguments? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;If we      want that any wildcard characters in the command line arguments should be      appropriately expanded, are we required to make any special provision? If      yes, which? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Does there      exist any way to make the command line arguments available to other      functions without passing them as arguments to the function? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are bit fields? What is the use of bit fields in a Structure declaration? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;To      which numbering system can the binary number 1101100100111100 be easily      converted to? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Which      bit wise operator is suitable for checking whether a particular bit is on      or off? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Which      bit wise operator is suitable for turning off a particular bit in a      number? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Which      bit wise operator is suitable for putting on a particular bit in a number?      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Which      bit wise operator is suitable for checking whether a particular bit is on      or off? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;which      one is equivalent to multiplying by 2:Left shifting a number by 1 or Left      shifting an unsigned int or char by 1? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program to compare two strings without using the strcmp() function. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program to concatenate two strings. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program to interchange 2 variables without using the third one. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      programs for String Reversal &amp;amp; Palindrome check &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program to find the Factorial of a number &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program to generate the Fibinocci Series &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program which employs Recursion &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program which uses Command Line Arguments &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Write      a program which uses functions like strcmp(), strcpy()? etc &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      are the advantages of using typedef in a program? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you dynamically allocate a one-dimensional and two-dimensional array      of integers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      can you increase the size of a dynamically allocated array? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      can you increase the size of a statically allocated array? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;When      reallocating memory if any other pointers point into the same piece of      memory do you have to readjust these other pointers or do they get      readjusted automatically? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Which      function should be used to free the memory allocated by calloc()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      much maximum can you allocate in a single call to malloc()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Can      you dynamically allocate arrays in expanded memory? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is object file? How can you access object file? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Which      header file should you include if you are to develop a function which can      accept variable number of arguments? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Can      you write a function similar to printf()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      can a called function determine the number of arguments that have been      passed to it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Can      there be at least some solution to determine the number of arguments passed      to a variable argument list function? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      do you declare the following: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt; line-height: 14.4pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;" lang="EN-US"&gt;&lt;span style=""&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;" lang="EN-US"&gt;An array of three pointers to chars &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt; line-height: 14.4pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;" lang="EN-US"&gt;&lt;span style=""&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;" lang="EN-US"&gt;An array of three char pointers &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt; line-height: 14.4pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;" lang="EN-US"&gt;&lt;span style=""&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;" lang="EN-US"&gt;A pointer to array of three chars &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt; line-height: 14.4pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;" lang="EN-US"&gt;&lt;span style=""&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;" lang="EN-US"&gt;A pointer to function which receives an int pointer and returns a float pointer &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt; line-height: 14.4pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;" lang="EN-US"&gt;&lt;span style=""&gt;o&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;" lang="EN-US"&gt;A pointer to a function which receives nothing and returns nothing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="80" type="1"&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      do the functions atoi(), itoa() and gcvt() do? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Does      there exist any other function which can be used to convert an integer or      a float to a string? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use qsort() function to sort an array of structures? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use qsort() function to sort the name stored in an array of      pointers to string? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use bsearch() function to search a name stored in array of      pointers to string? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use the functions sin(), pow(), sqrt()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use the functions memcpy(), memset(), memmove()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use the functions fseek(), freed(), fwrite() and ftell()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you obtain the current time and difference between two times? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you use the functions randomize() and random()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      would you implement a substr() function that extracts a sub string from a      given string? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the difference between the functions rand(), random(), srand() and      randomize()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;What      is the difference between the functions memmove() and memcpy()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;How      do you print a string on the printer? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: black; line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;" lang="EN-US"&gt;Can      you use the function fprintf() to display the output on the screen? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="line-height: 14.4pt;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;" lang="EN-US"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-4326615451077211881?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/4326615451077211881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=4326615451077211881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/4326615451077211881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/4326615451077211881'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/11/c-questions.html' title='C- Questions'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-8464838847901330902</id><published>2008-11-26T05:55:00.000-08:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>  The Basic sections of ‘C’ are explained taking an example::</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CUsers%5Csujata%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CUsers%5Csujata%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Csujata%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-IN&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="0" name="header"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-ansi-language:EN-US; 	mso-fareast-language:EN-US;} p.MsoHeader, li.MsoHeader, div.MsoHeader 	{mso-style-unhide:no; 	mso-style-link:"Header Char"; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:center 216.0pt right 432.0pt; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-ansi-language:EN-US; 	mso-fareast-language:EN-US;} span.HeaderChar 	{mso-style-name:"Header Char"; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:Header; 	mso-ansi-font-size:12.0pt; 	mso-bidi-font-size:12.0pt; 	mso-ansi-language:EN-US; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:595.45pt 841.7pt; 	margin:72.0pt 90.0pt 72.0pt 90.0pt; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:191266674; 	mso-list-type:hybrid; 	mso-list-template-ids:1708454770 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:36.0pt; 	mso-level-number-position:left; 	text-indent:-18.0pt;} @list l0:level3 	{mso-level-number-format:roman-lower; 	mso-level-tab-stop:117.0pt; 	mso-level-number-position:right; 	margin-left:117.0pt; 	text-indent:-18.0pt;} ol 	{margin-bottom:0cm;} ul 	{margin-bottom:0cm;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -36pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;i style=""&gt;&lt;span lang="EN-US"&gt;/* A program to calculate average of 5 nos given by the user */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;/*----------Defining of Constants and Inclusion Of Header Files------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;#include&lt;stdio.h&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;#define M 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;/*------------Start Of The Main Program---------------------------------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;/*----------------Declaration of Variables----------------------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;b style=""&gt;int&lt;span style=""&gt;  &lt;/span&gt;i; &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;int sum ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;/*-----------------Initialization of Values----------------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;sum=avg=0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;/*---------------Interaction With User and Receiving Required Data----*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;printf(“Please Enter The Values::”\n”);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;for (i=0; i&lt;=M; i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: 27pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;                       &lt;/span&gt;scanf(“%d”, &amp;amp;n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 81pt; text-indent: 27pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;sum=sum+n;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;/*---------------Display Of Final Result with The Computation-----------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;b style=""&gt;printf(“The Sum of All The Nos is: %d \n&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 45pt; text-indent: -9pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;The Average of All The 10 Nos is: %d\n”, sum, sum/10);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;u&gt;&lt;span lang="EN-US"&gt;The various data types supported in C&lt;/span&gt;&lt;/u&gt;&lt;span lang="EN-US"&gt; &lt;span style=""&gt; &lt;/span&gt;are basically divided into 4 types: primary or fundamental, user-defined, derived and empty data set.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;The Primary Data Type are mainly divided into 3 types which are sub-divided into many types like:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;1) INTEGER (int): different types of integers are:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;int, unsigned int, short int, unsigned short int, long int, and unsigned long int&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;2) Character (char): different types of characters are:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;signed char, unsigned char&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;3) Floating Point (float): different types of floats are:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;float, double, long double&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;An Example Program to Display Various Primary Data Types::&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;main()&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;int a;&lt;span style=""&gt;                &lt;/span&gt;/*------int range : -32,768&lt;span style=""&gt;  &lt;/span&gt;to 32,767-------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;short int c; &lt;span style=""&gt;      &lt;/span&gt;/*------short int range : -127 to 128-------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;long int d; &lt;span style=""&gt;       &lt;/span&gt;/*------long int range : -2,147,483,648 to 2,147,483,647-------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;float e; &lt;span style=""&gt;            &lt;/span&gt;/*------float range : -3.4E-38 to 3.4E+38-------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;double f; &lt;span style=""&gt;         &lt;/span&gt;/*------double range :&lt;span style=""&gt;  &lt;/span&gt;-1.7E-308 to 1.7E+308 -------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;char&lt;span style=""&gt;  &lt;/span&gt;g;&lt;span style=""&gt;                        &lt;/span&gt;/*------int range : -127 to 128-------*/&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;a=30007;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;c=120;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;d=89654785;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;e=954651.6216549;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;f=1.6E;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;span style=""&gt;            &lt;/span&gt;g=’M’;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;printf (“a=%d\n c=%d \n d=%d \n e=%f \n f=%f \n g=%c\n”, a, b, c, d ,e ,f ,g);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;RESULT: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;a=30007&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;c=120&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;d=89654785&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;e=954651.6216549&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span lang="EN-US"&gt;f=1.6E&lt;span style=""&gt;                                        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;g=M&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-8464838847901330902?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/8464838847901330902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=8464838847901330902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/8464838847901330902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/8464838847901330902'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/11/basic-sections-of-c-are-explained.html' title='  The Basic sections of ‘C’ are explained taking an example::'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-9188804101561406243</id><published>2008-11-20T01:55:00.000-08:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>C Objective Questions</title><content type='html'>  &lt;table style="border-collapse: collapse; width: 429pt;" border="0" cellpadding="0" cellspacing="0" width="572"&gt;&lt;col style="width: 189pt;" width="252"&gt;  &lt;col style="width: 48pt;" span="5" width="64"&gt;  &lt;tbody&gt;&lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="height: 25.5pt; width: 189pt;" width="252" height="34"&gt;No   commas or blanks are allowed within an integer or a real constant.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;'void' is a datatype.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;'emp name' is a valid variable name.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;'unsigned' is a valid variable name.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Operation between an integer and float always yields a float   result.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 51pt;" height="68"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 51pt; width: 189pt;" width="252" height="68"&gt;/* The C language.&lt;br /&gt;    /*&lt;span style=""&gt;  &lt;/span&gt;is a procedural language   .*/*/&lt;br /&gt;    	The above statement is valid.&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The default initial value of automatic storage class is 0.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;= and&lt;span style=""&gt;  &lt;/span&gt;= = have the same   operation.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Character data types cannot be declared as unsigned.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&amp;amp;&amp;amp; and &amp;amp; operators have the same meaning.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 38.25pt;" height="51"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 38.25pt; width: 189pt;" width="252" height="51"&gt;Right shifting an operand 1bit is equivalent to multiplying it   by 2.&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 38.25pt;" height="51"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 38.25pt; width: 189pt;" width="252" height="51"&gt;The same variable names of automatic type can be used in   different functions without any conflict.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;printf("%d", sizeof('2')); will print 2.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The expression "b = 3 ^ 2;" will evaluate b = 9.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The expression "int i = j = k = 0;" is invalid.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;printf() is not a library function.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;The expression (i + j)++ is illegal.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The expression 'int j = 6 + 3 % -9;' evaluates to -1.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;p++ executes faster than p + 1.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;static variable will not always have assigned value.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Variables declared as register storage type gets stored in CPU   registers.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Single operations involving entire arrays are permitted in   C.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;The main() function can   be called from any other function.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The main() function can call itself recursively.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The statement "for (i = 0, j = 2; j &lt;= 10; j++)" is   a valid statement in 'C'.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 38.25pt;" height="51"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 38.25pt; width: 189pt;" width="252" height="51"&gt;When a user defined function is defined in program, then it has   to be called at least once from the main().&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Left shift operator rotates the bits on the left and places them   to the right.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;A recursive function calls itself again and again.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;Only one break can be used in one loop.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Every if statement can be converted into an equivalent switch   statement.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;Nested macros are allowed.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;Expression 4**3 evaluates to 64.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;All macro substitutions in a program are done before compilation   of the program.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;'# define PI = 8;' is the correct declaration of macros.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;An array declared as A[100][100] can hold a maximum of 100   elements.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The array 'char name[10] can consist of a maximum of 9   characters.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;It is necessary to initialize the array at the time of   declaration.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;the value *(&amp;amp;i) is same as printing the value of address of   i.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;A pointer is an indication of the variable to be accessed   next.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The contents of a file opened in 'r+' mode cannot be   changed.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Union is used to hold different data at different time.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;All elements of a structure are allocated contiguous memory   locations.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;enum helps to create user defined datatype.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The value of an enumerated datatype can be read using scanf()   function.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;Structures within structures cannot be created.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;gets() and puts() are unformatted I/O functions.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;The identifier argv[] is a pointer to an array of strings.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;fprintf()function can be used to write into console.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;fopen() function returns a pointer to the open file.&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;True&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;False&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;Which of the following language is predecessor to C Programming   Language?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;BCPL&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;br /&gt;    C++&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;C programming language was developed by&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Dennis   Ritchie&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Ken   Thompson&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Bill   Gates&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Peter   Norton&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;C is a ___ language&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;High   Level and Procedural&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Low   Level and OOPS&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Middle   Level and Procedural&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Machine   Level and OOPS&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;Which escape character can be used to beep from speaker in   C?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;\a&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;\b&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;\m&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;\n&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 51pt;" height="68"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 51pt; width: 189pt;" width="252" height="68"&gt;&lt;span style=""&gt; &lt;/span&gt;Which of the following is   invalid?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;''&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;" "&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;'a'&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;'abc'  &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;A declaration float a, b; occupies ___ of memory&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;1   byte&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;4   bytes&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;8   bytes&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;16   bytes&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;The printf() function retunes which value when an error   occurs?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Positive   value&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Zero&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Negative   value&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;None   of these&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;Identify the wrong statement&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;putchar(65)&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;putchar('x')&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;putchar("x")&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;putchar('\n')&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;Which header file is essential for using strcmp()   function?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;string.h&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;strings.h&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;text.h&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;strcmp.h&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 63.75pt;" height="85"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 63.75pt; width: 189pt;" width="252" height="85"&gt;Which among the following is a unconditional control   structure&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;do-while&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;if-else&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;goto&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;for&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;continue statement is used&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;to   go to the next iteration in a loop&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;come   out of a loop&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;exit   and return to the main function&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;restarts   iterations from beginning of loop&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;Which of the following is an example of compounded assignment   statement?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;a   = 5&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;a   += 5&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;a   = b = c&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;a   = b&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;In the expression - 'x + y + 3z =20'&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;'x   + y' is a keyword&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;3   and 20 are constants&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;3z   is a constant&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;y   is a variable and z is a constant&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 153pt;" height="204"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 153pt; width: 189pt;" width="252" height="204"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    int z, a = 5, b = 3;&lt;br /&gt;    	z = a * 2 + 26 % 3;&lt;br /&gt;    	printf("%d", z);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;10&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;12&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;None   of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;Which options shows the correct hierarchy of arithmetic   operators&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;**,   * or /, + or -&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;**,   *, /, +, -&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;br /&gt;    **, /, *, +,-&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;/   or *, - or +&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 165.75pt;" height="221"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 165.75pt; width: 189pt;" width="252" height="221"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    	float a;&lt;br /&gt;    	int&lt;span style=""&gt;  &lt;/span&gt;x = 10, y = 3;&lt;br /&gt;    	a = x / y;&lt;br /&gt;    	printf("%f", a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;3.999999&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;3&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;3.000000&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 191.25pt;" height="255"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 191.25pt; width: 189pt;" width="252" height="255"&gt;The output of the following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    char a = 'B';&lt;br /&gt;    switch (a)&lt;br /&gt;    {&lt;br /&gt;    case 'A' : printf("a");&lt;br /&gt;    case 'B' : printf("b");&lt;br /&gt;    default&lt;span style=""&gt;   &lt;/span&gt;: printf("c");&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;B&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;b&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;bca&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;bc&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 153pt;" height="204"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 153pt; width: 189pt;" width="252" height="204"&gt;The output of the following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    int a = 20;&lt;br /&gt;    	printf("%d\t%d\n", ++a, a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;21	21&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;20	21&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;21	20&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;20	20&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 102pt;" height="136"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 102pt; width: 189pt;" width="252" height="136"&gt;How many times the following loop will execute?&lt;br /&gt;    for (a = 0; a &lt; 4; a++)&lt;br /&gt;    printf("hello\n");&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;3&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;4&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;5&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;infinite&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 178.5pt;" height="238"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 178.5pt; width: 189pt;" width="252" height="238"&gt;The output of the following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    	int a;&lt;br /&gt;    	int &amp;amp;b = a;&lt;br /&gt;    	a=100;&lt;br /&gt;    	&lt;br /&gt;    	printf("b=%d\ta=%d\n", b,a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;b=100	a=100&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;b=100	a=0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;b=0		a=100&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Error&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 178.5pt;" height="238"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 178.5pt; width: 189pt;" width="252" height="238"&gt;&lt;br /&gt;    The output of the following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    	int a = 0;&lt;br /&gt;    	while (a&lt;=50)&lt;br /&gt;    		for(;;)&lt;br /&gt;    		if(++a % 50==0)&lt;br /&gt;    			break;&lt;br /&gt;    		printf("a = %d", a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;a = 100&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;a   = 50&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;compilation   error&lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;runtime error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 242.25pt;" height="323"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 242.25pt; width: 189pt;" width="252" height="323"&gt;The output of the following code is:&lt;br /&gt;    int f(int a, int b);&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    	int a = 12, b=154;&lt;br /&gt;    	printf("%d", f(a, b));&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;    int f(int a, int b)&lt;br /&gt;    {&lt;br /&gt;    	if (a&lt;b) return(f(b, a));&lt;br /&gt;    	if(b==0) return(a);&lt;br /&gt;    	return (f(b, a % b));&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;2&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;1&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Compilation error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Runtime error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 191.25pt;" height="255"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 191.25pt; width: 189pt;" width="252" height="255"&gt;The output of the following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    	int a = 1, b=2;&lt;br /&gt;    	int *ip;&lt;br /&gt;    	ip=&amp;a;&lt;br /&gt;    	b=*ip;&lt;br /&gt;    	printf("%d", b);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;2&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;1&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;100&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 178.5pt;" height="238"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 178.5pt; width: 189pt;" width="252" height="238"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    void main()&lt;br /&gt;    {&lt;br /&gt;    	static int a = 1, b, c;&lt;br /&gt;    	if (a&gt;=2)&lt;br /&gt;    		b=2;&lt;br /&gt;    		c=3;&lt;br /&gt;    	printf("%d\t%d", b,c);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;2	3&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;0	3&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;0	0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;2	0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 153pt;" height="204"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 153pt; width: 189pt;" width="252" height="204"&gt;The output of the following code is:&lt;br /&gt;    #define sqr(x= x*x)&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    	int a = 10, b = 5;&lt;br /&gt;    	printf("%d, %d", sqr(a+b),sqr(++a));&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;77, 121&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;225, 121&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;77, 144&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Compilation error&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 153pt;" height="204"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 153pt; width: 189pt;" width="252" height="204"&gt;&lt;span style=""&gt; &lt;/span&gt;struct stud&lt;br /&gt;    {&lt;br /&gt;    int roll;&lt;br /&gt;    char name[20];&lt;br /&gt;    float marks;&lt;br /&gt;    } *p;&lt;br /&gt;   &lt;br /&gt;    What will be the byte size of p?&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;24&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;2&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;26&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;None&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 204pt;" height="272"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 204pt; width: 189pt;" width="252" height="272"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    unsigned int a = 10;&lt;br /&gt;    while (a&gt;=10)&lt;br /&gt;    {&lt;br /&gt;    int a;&lt;br /&gt;    a-- ;&lt;br /&gt;    }&lt;br /&gt;    printf("%i", a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Infinite loop&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;9&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;None&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 204pt;" height="272"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 204pt; width: 189pt;" width="252" height="272"&gt;The output of the following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    xyz:&lt;br /&gt;    goto abc;&lt;br /&gt;    printf("Hello");&lt;br /&gt;    abc:&lt;br /&gt;    printf("World");&lt;br /&gt;    goto xyz;&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Infinite loop&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Hello World&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;World Hello&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Compilation error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 165.75pt;" height="221"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 165.75pt; width: 189pt;" width="252" height="221"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    int a = 0;&lt;br /&gt;    for (; i = 0; i++)&lt;br /&gt;    	printf("%d", a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Nothing   will be displayed&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Infinite loop&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;None of the above&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 216.75pt;" height="289"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 216.75pt; width: 189pt;" width="252" height="289"&gt;The output of the following code is:&lt;br /&gt;    void change (char *k)&lt;br /&gt;    {&lt;br /&gt;    	k="Hello";&lt;br /&gt;    return;&lt;br /&gt;    }&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    char *ch = "World";;&lt;br /&gt;    change(ch);&lt;br /&gt;    printf("%s", ch);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Hello&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;World&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Compilation error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Hello World&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;&lt;span style=""&gt; &lt;/span&gt;Which of the following is   not an infinite loop&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;int i =1;&lt;br /&gt;    while (1)&lt;br /&gt;    {i++;}&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;for( ; ; );&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;int true=0, false;&lt;br /&gt;    while (true)&lt;br /&gt;    {false = 1;}&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;int y, x = 0;&lt;br /&gt;    do&lt;br /&gt;    {y = x;}&lt;br /&gt;    while (x==0);&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 76.5pt;" height="102"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 76.5pt; width: 189pt;" width="252" height="102"&gt;do-while loop is useful when we want the statements within the   loop must be executed&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Only once&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;At least once&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;More than Once&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Any one of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;Which of the following is not a preprocessor directive&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;#if&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;#elseif&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;#undef&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;#pragma&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 127.5pt;" height="170"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 127.5pt; width: 189pt;" width="252" height="170"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    int a = 5, b = 6;&lt;br /&gt;    (a == b? printf("%d", a));&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;5&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Error&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;None of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 153pt;" height="204"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 153pt; width: 189pt;" width="252" height="204"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    int k, num = 30;&lt;br /&gt;    k = (num &gt; 5 ? (num &lt;= 10 ? 100 : 200) : 500);&lt;br /&gt;    printf("\n%d", num);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;200&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;500&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;30&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Unpredictable&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 140.25pt;" height="187"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 140.25pt; width: 189pt;" width="252" height="187"&gt;The output of the following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    void msg()&lt;br /&gt;    {&lt;br /&gt;    printf("HELLO WORLD");&lt;br /&gt;    }&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;HELLO WORLD&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Error&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;None of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 191.25pt;" height="255"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 191.25pt; width: 189pt;" width="252" height="255"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    int sub[50];&lt;br /&gt;    for(i=0; i&lt;=48;i++)&lt;br /&gt;    {&lt;br /&gt;    sub[i]=i;&lt;br /&gt;    printf("\n%d", sub[i]);&lt;br /&gt;    }&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;0 to 48 will be displayed&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;48&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;49&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;Compilation   Error&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 178.5pt;" height="238"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 178.5pt; width: 189pt;" width="252" height="238"&gt;&lt;span style=""&gt; &lt;/span&gt;The output of the   following code is:&lt;br /&gt;    main()&lt;br /&gt;    {&lt;br /&gt;    int a[10], i;&lt;br /&gt;    for (i = 1; I &lt;= 0; i++)&lt;br /&gt;    {&lt;br /&gt;    scanf("%d", a[i]);&lt;br /&gt;    printf("%d", a[i]);&lt;br /&gt;    }&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;10&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Logical error&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;Runtime error&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;1&lt;span style=""&gt;  &lt;/span&gt;to   10 will be displayed&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 89.25pt;" height="119"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 89.25pt; width: 189pt;" width="252" height="119"&gt;&lt;span style=""&gt; &lt;/span&gt;Which of the following   expressions is wrong&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;float a =123.56;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;char ch ='T' * 'A';&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;char ch ='T' *20;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;3 +a = b;&lt;span style=""&gt;  &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;D&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;strcat() function ----------------------- two strings.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;delete&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;concatenate&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;compare&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;none   of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 38.25pt;" height="51"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 38.25pt; width: 189pt;" width="252" height="51"&gt;&lt;span style=""&gt; &lt;/span&gt;A function to be called   must be ended with a----------------&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;?&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;none   of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;The function fopen() on   failure returns---------------------.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;NULL&lt;span style=""&gt; &lt;/span&gt;&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;1&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;none   of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;The--------------------   statement helps immediate exit from any part of the loop&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;&lt;span style=""&gt; &lt;/span&gt;break&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;continue&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;exit&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;All   of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;The   -------------------------- loop executes at least once.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;for&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;while&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;do-while&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;while   &amp;amp; do-while&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;char *s[10] defines an   array of ------------------------&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;pointers   to strings&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;string   to pointer&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;both&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt; &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;A multidimensional array   A[10][9] can store-------- number of elements&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;91&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;88&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;90&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;89&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 12.75pt;" height="17"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 12.75pt; width: 189pt;" width="252" height="17"&gt;The size of signed integer is ------ bytes.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;4&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;2&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;8&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;10&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;There are total ------ numbers of operators in 'C'.&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;35&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;45&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;55&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;40&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;------ is the ternary operator&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;?,-&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;?,:&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;++,--&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;none   of the above&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;B&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 25.5pt;" height="34"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 25.5pt; width: 189pt;" width="252" height="34"&gt;&lt;span style=""&gt; &lt;/span&gt;unsigned char has a range   from 0 to ------------&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;253&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;254&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;255&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;256&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;C&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 51pt;" height="68"&gt;   &lt;td class="xl64" style="border-top: medium none; height: 51pt; width: 189pt;" width="252" height="68"&gt;&lt;span style=""&gt; &lt;/span&gt;If&lt;span style=""&gt;  &lt;/span&gt;'str' is a string of 7 characters, the   statement printf("%4s", str); will display ------characters.&lt;br /&gt;    &lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;4&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;7&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;6&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;0&lt;/td&gt;   &lt;td class="xl64" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64"&gt;A&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-9188804101561406243?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/9188804101561406243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=9188804101561406243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/9188804101561406243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/9188804101561406243'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/11/c-objective-questions.html' title='C Objective Questions'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-7960649813396644619</id><published>2008-10-22T22:02:00.000-07:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C FAQs'/><title type='text'>C Programming FAQs</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;ZH-MO&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="0" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="0" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Hyperlink"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Normal (Web)"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Cite"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Code"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Preformatted"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h3 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-link:"Heading 3 Char"; 	mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	mso-outline-level:3; 	font-size:13.5pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-language:EN-US; 	font-weight:bold;} h4 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-link:"Heading 4 Char"; 	mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	mso-outline-level:4; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-language:EN-US; 	font-weight:bold;} a:link, span.MsoHyperlink 	{mso-style-noshow:yes; 	mso-style-unhide:no; 	color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{mso-style-noshow:yes; 	mso-style-priority:99; 	color:purple; 	mso-themecolor:followedhyperlink; 	text-decoration:underline; 	text-underline:single;} p 	{mso-style-unhide:no; 	mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} code 	{mso-style-unhide:no; 	font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-fareast-font-family:"Courier New"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New";} pre 	{mso-style-unhide:no; 	mso-style-link:"HTML Preformatted Char"; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Courier New"; 	mso-fareast-language:EN-US;} span.Heading3Char 	{mso-style-name:"Heading 3 Char"; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"Heading 3"; 	mso-ansi-font-size:13.5pt; 	mso-bidi-font-size:13.5pt; 	mso-fareast-language:EN-US; 	font-weight:bold;} span.Heading4Char 	{mso-style-name:"Heading 4 Char"; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"Heading 4"; 	mso-ansi-font-size:12.0pt; 	mso-bidi-font-size:12.0pt; 	mso-fareast-language:EN-US; 	font-weight:bold;} span.HTMLPreformattedChar 	{mso-style-name:"HTML Preformatted Char"; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"HTML Preformatted"; 	font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-fareast-font-family:"Courier New"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New"; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:232473620; 	mso-list-type:hybrid; 	mso-list-template-ids:-214554980 -1 -1 -1 -1 -1 -1 -1 -1 -1;} @list l0:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l1 	{mso-list-id:1667319723; 	mso-list-type:hybrid; 	mso-list-template-ids:1044964050 -1 -1 -1 -1 -1 -1 -1 -1 -1;} @list l1:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;&lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;infrequently-asked questions and their answers: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 1: Declarations and Initializations [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#section-1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.1: How do you decide which integer type to use?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Use ``short'' when you need to avoid values over 32,767, ``int'' when you want to store integers, ``long'' for long numbers (more than 6 digits), and ``float'' for numbers over 4 billion. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.2: What should the 64-bit type on new, 64-bit machines be?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;int. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.3: If I write the code &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;int i, j;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; can I assume that &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;(&amp;amp;i + 1) == &amp;amp;j&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Only sometimes. It's not portable, because in EBCDIC, i and j are not adjacent. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.4: What's the best way to declare and define global variables?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;In headers; this way, you can get link errors when you include the same header twice. Generally, you will have to define a variable everywhere you want to use it, and then declare it someplace so you know what it is. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.4"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.5: What does extern mean in a function declaration?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It refers to a variable which is not actually in your program. For instance, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;main() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;extern int bar;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;printf("%d\n", bar);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;will compile without errors because bar is declared as being external. (It won't run, though, because you never assign bar a value.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.5"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.6: I finally figured out the syntax for declaring pointers to functions, but now how do I initialize one?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;With the assignment operator. You were perhaps expecting a screwdriver? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.7: I've seen different methods used for calling through pointers to functions. What's the story?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;In the old days, when Microsoft first invented C, the syntax for calling functions involved more parentheses; this was after their market research indicated that most C programmers would be coming from a Lisp environment. Later, when Kernighan took over the language design (right after AT&amp;amp;T bought Microsoft's language technology), he decided to eliminate the parentheses, but the old form is still allowed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You do need the parentheses to call a function with more than one argument, for instance, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;int (*foo)(char *, ...) = printf;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(*foo)("hello, %s\n", "world!");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;needs the parens, but they would not be needed for &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;foo, "hello, world!\n";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(The ``*'' just means to execute foo, just like the ``*'' on the end of an executable filename in ``ls -F''.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.7"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.8: What's the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;auto&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; keyword good for?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Declaring vehicles.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.9: I can't seem to define a linked list successfully. I tried&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;typedef struct {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;char *item;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;NODEPTR next;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;} *NODEPTR;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;but the compiler gave me error messages. Can't a structure in C contain a pointer to itself? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Not exactly; it can contain a pointer to another structure of the same type. Try: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;typedef struct {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char *item;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;double *next;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;} NODEFAKE;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;typedef struct {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char *item;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;NODEFAKE *next;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;} NODEPTR;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Make sure that sizeof(NODEPTR) == sizeof(double). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This technique is called a ``backwards reference''. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.9"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.10: How do I enter values using hexadecimal?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;long ints can be entered using hexadecimal notation; for instance, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;long int foo = 07;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;sets foo to hex 7. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.10"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;1.11: How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Well, first you need to know how to declare an array of N items of type T - that's &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;T foo[N];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Now you need to look at how to declare a pointer to function returning something, say, an object of type S. That's like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;S (*bar)();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Now assume that S is ``pointer to function returning pointer to char''. We get &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(char *) (*)() (*bar)().&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;So, the whole thing turns out to be (with appropriate parentheses) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(((char)(*))((*)())(((*)((foo)))())([(N)]));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;If your compiler complains, break this down into subexpressions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;To call it, just use &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;foo[i]();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This works because, in C, declaration reflects use, but it's one of those weird distorted mirrors. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-1.11"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 2: Structures, Unions, and Enumerations [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#section-2"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.1: What is the difference between an &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;enum&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; and a series of preprocessor &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#define&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;s?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;enum&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; doesn't require the preprocessor. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.2: I heard that structures could be assigned to variables and passed to and from functions, but &lt;/span&gt;&lt;cite&gt;&lt;span style="font-size:11;"&gt;K&amp;amp;R I&lt;/span&gt;&lt;/cite&gt;&lt;span style="font-size:11;"&gt; says not.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;K&amp;amp;R I&lt;/span&gt;&lt;/b&gt;&lt;/cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; was wrong; they hadn't actually learned C very well before writing the book. Later, Ritchie got a job at Bell Labs, and worked closely with the authors of C, allowing the 2nd edition of the book to be much more accurate. (Kernighan already worked at Bell Labs, as a video game developer.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.2"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.3: How does struct passing and returning work? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The structures are put into the low part of the VGA card's VRAM. They are then removed before the next video update. This is why struct passing was not supported for a long time; VGA cards were prohibitively expensive. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;If you try to pass very large structures on the stack, you may see odd screen graphics. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.4: Why can't you compare structs?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Compare them to what? A summer's day? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.5: How can I read/write structs from/to data files?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Loop with &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;putchar&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. Be careful; if your machine uses signed chars by default, all of the sign bits in your structure elements will be reversed. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.5"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.6: How can I determine the byte offset of a field within a structure?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It's generally 4 times the number of members of the structure. It may be more or less on some machines. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.6"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.7: How can I access structure fields by name at run time? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;foo."name" should work. You may need to overload the . operator, which, in turn, may overload your C compiler. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.8: Why does sizeof report a larger size than I expect for a structure type, as if there was padding at the end? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because there's padding at the end. &lt;strong&gt;Duh&lt;/strong&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.9: My compiler is leaving holes in structures, which is wasting space and preventing ``binary'' I/O to external data files. Can I turn off the padding, or otherwise control the alignment of structs? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Sure. What you do to eliminate the padding in structures is use unions; for intance, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;struct foo {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char c;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;long l;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char d;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char e;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char f;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;may cause struct foo to be padded to 12 bytes, rather than the correct size of 8. Try &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;union foo {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;double _d;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char c, d, e, f;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;long l;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;which will be 8 bytes. (The double is for alignment.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.9"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.10: Can I initialize unions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Depends. They may go on strike when provoked. Luckily, if your program involves air traffic control, the ISO standard guarantees that Ronald Reagan will fire any unions that go on strike, and replace them with structs, which should be close enough. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.10"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;2.11: How can I pass constant values to routines which accept struct arguments? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Try foo((struct foo) 3). [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-2.11"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 3: Expressions [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#section-3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.1: Why doesn't the code &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;a[i] = i++;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; work? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You didn't declare either i or a. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.2: Under my compiler, the code &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;int i = 7;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;printf("%d\n", i++ * i++);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;prints 49. Regardless of the order of evaluation, shouldn't it print 56? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No. The only logical answer would be 81 - two postfix ++'s are automatically converted to prefix. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.3: I've experimented with the code &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;int i = 2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;i = i++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;on several compilers. Some gave i the value 2, some gave 3, but one gave 4. I know the behavior is undefined, but how could it give 4? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because i is 2, the loop is executed twice. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.4: People keep saying the behavior is undefined, but I just tried it on an ANSI-conforming compiler, and got the results I expected. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;They were probably wrong. Flame them mercilessly. Be sure before you do that your compiler is &lt;/span&gt;&lt;/b&gt;&lt;em&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;really&lt;/span&gt;&lt;/b&gt;&lt;/em&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; ANSI conforming, though. If it turns out you were wrong, they get a legal claim on your first-born. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.5: Can I use explicit parentheses to force the order of evaluation I want? Even if I don't, doesn't precedence dictate it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No. To force order of evaluation, you must threaten it. Take the comma operator hostage. Using it, you can force the other operators to do what you want. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-3.5"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.6: But what about the &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;, &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;||&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;, and comma operators? I see code like ``&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;if((c = getchar()) == EOF || c == '\n')&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;'' ... &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;As noted, once you've captured the comma operator, the others become docile. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.7: If I'm not using the value of the expression, should I use &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;i++&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; or &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;++i&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; to increment a variable? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;++i&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. Only losers and idiots use &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;i++&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. This is different if your native language would idiomatically use ``i increment'', but in English and related languages, you must use &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;++i&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. Note that a modern program must use both, dependent on the current locale. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;3.8: Why is &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;i = ++i&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; undefined? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because it is unclear whether it is shorthand for &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;i = 42;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; or &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;i = (char *) "forty two";&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Given the ambiguity, the standards committee decided to leave it undefined. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 4: Null Statements [a]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.1: What is this infamous null statement, anyway? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;A null statement is an expression statement consisting solely of the terminating semicolon. The optional expression is dropped. It can be distinguished from any other statement by byte count or study of side-effects. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.2: How do I ``get'' a null statement in my programs? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;In ANSI C, there are six types of statements; labeled statements, compound statements, expression-statements, selection statements, iteration statements, and jump statements. All of them, except the jump and expression statments, are defined in terms of optional preceeding text, and other statements. The jump statements are never null statements. An expression statement is considered to be ``a null statement'' if the optional expression part of it has been left out. A null statement can appear on its own, or (most frequently) as the statement body of an iteration statement. These two null statements are equivalent, though neither of them is equivalent to any non-null statement. [*] &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You may accidentally get a null statement by deleting the body of a non-null statement. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;[*] Actually, they are functionally equivalent to a large set of non-null statements, namely, those with no side-effects. However, the FDA has yet to approve any such, as their lack of side effects is conjectured, and not clinically proven. This applies only to the ANSI standard, and not the ISO standard, as the FDA has no jurisdiction outside the U.S. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-4.2"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.3: Is there more than one null statement?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Sort of. You can use ``;'', ``0;'', or ``1;'' - they will all act like a null statement. Only the first is a ``true'' null statement (all bits zero). They are basically equivalent. Note that (void *) 0; is a null statement of type pointer to void, for instance. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-4.3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.4: But I thought &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;{ }&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; was a null statement!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No. &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;{ statement-list[opt] }&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; is a compound statement. An empty block is not the same as a null statement, however, although it can be used in many of the same places. It's really a null block. (You can convert it with a cast, but it's not directly compatible. For instance, you can't use a null block as one of the controlling statements of a for loop.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.5: I use the statement &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#define NULLSTMT(F) (F) ;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; to allow me to cast a null statement to an appropriate type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This trick, though popular in some circles, does not buy much. The resulting code is invalid, and will not compile. This (in the author's opinion) outweighs any arguable type consistency. It may be more common in industrial code. If it becomes common practice, C++ will probably legalize it. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-4.5"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.6: I use the statement &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#define NULLSTMT(F) (F) 0;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; to allow me to cast a null statement to an appropriate type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This trick will likely work, but think: what does it really buy you? Mostly, it will indicate to even the most casual observer that you are shakey on the concept of null statements, making it harder for them to check your code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.7: But wouldn't it be better to use &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; (rather than &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;0;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;) in case the value of 0 changes, perhaps on a machine with nonzero no-op instructions? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No. The '&lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;0&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;' of '&lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;0;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;' is not evaluated as an instruction, rather, it is just ignored. The only reason to use '&lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;0;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;' instead of '&lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;' is to help keep 1-heavy code properly balanced (in C, which uses binary representations for numbers, it is possible for code to become unbalanced; an unbalanced binary tree is a common source of poor performance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.8: Is a null statement a null pointer? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No. A null pointer is a pointer where all of the address bits are zero (no matter what the segment bits are), and can be obtained by typing '(char *) (int) 0'. A null statement is not a pointer to anything. They are not interchangeable, although you can combine them to get an effectively-null statement, such as &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;NULL;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. This does not buy you anything. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-4.8"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;4.9: I'm still confused. I just can't understand all this null statement stuff. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Follow these two simple rules: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style="margin-top: 5pt; margin-bottom: 5pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;When you don't want to      do anything in source code, don't write it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin-top: 5pt; margin-bottom: 5pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;If you need a null      statement to round out an expression, use an unadorned &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; to      provide it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin-top: 5pt; margin-bottom: 5pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Send large donations,      checks, and money orders to the author of the FAQ, or the moderator of the      group, whichever you prefer. Then, cross the top question off the FAQ,      answer the question at the bottom, and mail it to three people. Within two      weeks, you will receive 729 answers to various questions! Do not break the      chain; Emily Postnews broke the chain, and now no one listens to her. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-4.9"&gt;a&lt;/a&gt;]      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 5: Arrays and Pointers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.1: I had the definition &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;char a[6]&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; in one source file, and in another I declared &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;extern char a[]&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;. Why did it work?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The declaration &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;extern char a[]&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; simply matches the actual definition. The type ``array-of-type-T'' is the same as ``array-of-type-T.'' Go ahead and use &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;extern char a[]&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;. (For greater portability, use it in both files, not only in one of them.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-5.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.2: But I heard that &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;char a[]&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; was different from &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;char a[6]&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This is true. However, the declaration &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;a[]&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; is compatible with the definition &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;a[6]&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.3: So what is meant by the ``equivalence of pointers and arrays'' in C?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Very little.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.4: Then why are array and pointer declarations interchangeable as function formal parameters?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Classism. We consider arrays ``second class objects''. They don't vote, and they get treated as pointers. Additionally, they're merely objects, not citizens. Marx wrote about this a lot. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-5.4"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.5: Why doesn't sizeof properly report the size of an array which is a parameter to a function? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Part of the ANSI conspiracy to restrict people to passing pointers; this was undertaken after the first discovery that passing large arrays recursively could cause crashes. Since then, with the passing of MS-DOS, it has become a non-issue; since all serious machines have virtual memory, you can pass as much data as you want on the stack without detectable problems. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-5.5"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.6: Someone explained to me that arrays were really just constant pointers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Cool. Someone I know says he saw Elvis in a local bar. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-5.6"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.7: Practically speaking, what is the difference between arrays and pointers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;About the difference between alcohol and marijuana; they have different characteristics, and that's not a problem if you don't mix them too carelessly. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.8: I came across some ``joke'' code containing the ``expression'' &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;5["abcdef"]&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;. How can this be legal C? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It was added to allow people to avoid the character constant 'f' which may not be available on some systems. (Actually, it's a side-effect of the equivalence of arrays and pointers.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-5.8"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;5.9: How would I initialize an entire array from standard input? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You have to use a loop. For instance, the following code reads the numbers zero through 99 into the array a. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;for (i = 0; i &lt;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;a[i] = (scanf, ("%d", i));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Make sure to include &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;stdio.h&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;, or this may not work. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-5.9"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 6: Memory Allocation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.1: Why doesn't this fragment work? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char *answer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;printf("Type something:\n");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;gets(answer);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;printf("You typed \"%s\"\n", answer);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The semicolon after ``answer'' is missing. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-6.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.2: I have a function that is supposed to return a string, but when it returns to its caller, the returned string is garbage. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You probably returned a pointer to a local array. That doesn't work. Try using a temporary file, instead. For instance: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;char *getstr(void) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;FILE *fp = tmpfile();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;fputs(gets(NULL), fp);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return (char *) fp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.3: Why does some code carefully cast the values returned by malloc to the pointer type being allocated? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;In interrupt-riddled code, it may be necessary to cast values to force the CPU to resolve pointer types. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-6.3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.4: You can't use dynamically-allocated memory after you free it, can you? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Yes. However, what happens when you do is not clearly defined. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.5: How does free() know how many bytes to free? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Interrupt 41h. On macs, amigas, and other ``big-endian'' processors, that would be interrupt 14h; be wary of portability problems. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-6.5"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.6: So can I query the malloc package to find out how big an allocated block is? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Not exactly; because the objects are dynamically allocated, their size can change at run time, so this will not be reliable. If you restrict your allocation to allocating sizeof(void *) bytes at a time, you will find that you can use sizeof() to get the size of a block, in the obvious way. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.7: I'm allocating structures which contain pointers to other dynamically-allocated objects. When I free a structure, do I have to free each subsidiary pointer first? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No. You just have to keep track of them somewhere else also. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.8: Was Proust's masterwork, &lt;/span&gt;&lt;cite&gt;&lt;span style="font-size:11;"&gt;A Remembrance of Things Past&lt;/span&gt;&lt;/cite&gt;&lt;span style="font-size:11;"&gt;, the basis for the C library's allocation scheme, based largely on contextual analysis? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The standard does not specify an allocation scheme; the famous author the allocation scheme is based on is implementation specified. Proust is a common choice, however. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;6.9: I have a program which mallocs but then frees a lot of memory, but memory usage (as reported by ps) doesn't seem to go back down. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You're probably not freeing the memory completely. Try replacing '&lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;free(foo);&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;' with&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;free(foo);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;free(foo);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;free(foo);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;in case the first &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;free()&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; frees the memory only partially. (Unix wizards may recognize the parallel with syncing three times before rebooting.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Alternatively, free(foo) + 4; may free the remaining four bytes. (Before using this, make sure realloc(foo, 0) returned 4). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 7: Characters and Strings&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;7.1: How can I get the numeric (character set) value corresponding to a character, or vice versa? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The obvious way is to write a function to do the conversion. (Error checking has been omitted for brevity.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;int ctoi(char c) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;static unsigned char *ary;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;/* initialize the array */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;if (!ary) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;int i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;ary = malloc(UCHAR_MAX + 2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;for (i = 0; i &lt;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;ary[i] = i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;ary[UCHAR_MAX + 1] = '\0';&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;if (c) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;unsigned char *t;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;/* we have to skip the leading NUL */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;t = strchr(ary + 1, c);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;if (!t)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;return t - ary;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;} else {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;/* special case for NUL character */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;There are various clever tricks you can use to get around writing the function, but most are too complicated for beginners. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-7.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 8: Boolean Expressions and Variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;8.1: What is the right type to use for boolean values in C? Why isn't it a standard type? Should &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#define&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;s or &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;enum&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;s be used for the true and false values? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;int (*)(int, char **)&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; makes a good boolean type. You can use &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;main&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; for true, and &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;exit&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; for false. On some compilers, you may need to cast &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;exit()&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; to an appropriate type. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;8.2: Isn't &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#defining&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; TRUE to be 1 dangerous, since any nonzero value is considered ``true'' in C? What if a built-in boolean or relational operator ``returns'' something other than 1? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Very good! For instance, one program I saw used &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#define TRUE(x) ((x) &amp;amp; 0x100)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;for compatability with a specific release of a FORTRAN compiler, which used 0 for .FALSE. and 256 for .TRUE. - this allowed them to change their code with every new release of the FORTRAN compiler, and kept them alert to changes. This has no relationship to the boolean or logical operators in C, which always return 0 or 1. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;8.3: What is truth? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It is not a saffron-robed monk, pissing in the snow. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-8.3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 9: C Preprocessor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;9.1: How can I use a preprocessor &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#if&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; expression to tell if a machine is big-endian or little-endian? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#ifdef __BIG_ENDIAN&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; should work on all known machines; Borland defines it. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-9.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;9.2: I've got this tricky processing I want to do at compile time and I can't figure out a way to get cpp to do it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Poor baby. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;9.3: How can I list all of the pre-&lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#define&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;d identifiers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#define __ALL_CPP_IDS&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; - put this in a source file, and run it through your C preprocessor. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;9.4: How can I write a cpp macro which takes a variable number of arguments? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Try something like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#define add(x) (x)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#define add(x, y) (x + y)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#pragma induction add&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;9.5: Shouldn't the following code: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define ROSE 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define CHRYSANTHEMUM 2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define RHODODENDRON 3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define WATER_LILY 4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;printf("%d\n", CHRYSATHNEMUM);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;print ``2''? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You misspelled CHRYSANTHEMUM. Use abbreviations for long flower names in C code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 10: ANSI C&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.1: What is the ``ANSI C Standard?'' &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;A whiny bunch of lusers who haven't written as many books as Herbert Schildt. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-10.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.2: How can I get a copy of the Standard? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Use a copier. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.3: Does anyone have a tool for converting old-style C programs to ANSI C, or vice versa, or for automatically generating prototypes? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;A router helps, but your best bet is still the band saw. Quick, efficient, and powerful. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.4: I'm trying to use the ANSI ``stringizing'' preprocessing operator &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;#&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; to insert the value of a symbolic constant into a message, but it keeps stringizing the macro's name rather than its value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This is because &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;"3"&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; is not a legal integral constant in C - it's a string constant. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.5: I don't understand why I can't use const values in initializers and array dimensions, as in &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;const int n = 7;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;int a[n];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because you're not using C++. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.6: What's the difference between ``char const *p'' and ``char * const p''? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;One `` '' character. There are some trivial differences having to do with the distinction between a pointer to a constant, and a constant pointer, but since you can cast either to a (char *) it hardly matters. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.7: Can I declare main as void, to shut off these annoying ``main returns no value'' messages? (I'm calling exit(), so main doesn't return.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Certainly. You can also declare it as double. It may not compile, or it may crash, but who cares? No lousy bunch of whining lusers is going to tell *you* what to do. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.8: Why does the ANSI Standard not guarantee more than six monocase characters of external identifier significance? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because none of the members of the committee had names over six letters, or in which letters other than the first were capitalized. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-10.8"&gt;a&lt;/a&gt;] &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.9: What is the difference between memcpy and memmove? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;memmove moves memory, and memcpy copies it. memmove may not be supported on machines without internal robot arms. Do not use memmove while the machine is powered up - you can destroy your memory. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.10: Why won't the Frobozz Magic C Compiler, which claims to be ANSI compliant, accept this code? I know that the code is ANSI, because gcc accepts it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The Frobozz Magic Company lies through its teeth. Consider: does Flood Control Dam #3 actually control floods? Didn't think so. The wands are excellent for making useless via casts of Float, though. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-10.10"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.11: Why can't I perform arithmetic on a void * pointer? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You're too big and clumsy. When you try to push the numbers together, you lose your balance. Perhaps you should get some angels from the rave over on pin 3. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.12: What are #pragmas and what are they good for? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;They are useful ways to eliminate compiler features which are not helpful to your goals; contrast #utility, which introduces useful compiler features, and #absolutist, which introduces those compiler features believed to be right. #relativist is supported by some compilers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.13: What does ``#pragma once'' mean? I found it in some header files. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It means that your program will only run once; it's used to create ``crippled demos''. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-10.13"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.14: People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. What's the difference? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;There isn't really one; people just enjoy flaming over nits. (To be technical, one has a hyphen, one has a space, and one is a single word.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;10.15: Is C an acronym? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Yes, it stands for ``C''. It's another of those funky recursive acronyms. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 11: Stdio&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.1: What's wrong with this code: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;char c;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;while((c = getchar()) != EOF)...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You forgot to include space for the terminating NUL character, so the compiler can't find the end of c without overwriting other memory. In all probability, after the user types ``n&lt;return&gt;'', your code will look like &lt;o:p&gt;&lt;/o:p&gt;&lt;/return&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;char cn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;while((c = getchar()) != EOF)...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;which won't compile. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Also, the ellipsis is not legal outside of function protoypes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Try &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;char c[2]; /* include space for terminating NUL */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;while ((c = getchar()) != EOF)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Note the use of the null statement to absorb the NUL. (See &lt;a href="http://www.plethora.net/%7Eseebs/faqs/#section-4"&gt;Section 4&lt;/a&gt;.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.2: How can I print a ``%'' character in a printf format string? I tried ``\%'' but it didn't work. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Break the '%' sign out. i.e., fprintf("foo " "%" "%d\n", foo); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Alternatively, try &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;sprintf("o" "/" "o") to get a "%". &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The astute reader will notice that the latter example uses sprintf, and the former fprintf - this is because sprintf() works by characters, or strings, while fprintf (``fast printf'') works on files. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-11.2"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.3: Why doesn't the code scanf("%d", i); work? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You need to do this a bit differently; you should always check for the return from scanf, so try something like &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;i = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;if ((scanf, "%d", i) == 1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;to make sure you're reading correctly. (The assignment to i is so that, if scanf fails, you still have a legal value in i.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.4: Once I've used freopen, how can I get the original stdout (or stdin) back? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Call main() - the environment will be restored. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.5: Why won't the code &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;while(!feof(infp)) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;fgets(buf, MAXLINE, infp);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;fputs(buf, outfp);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;work? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because the end of file character is not detected on files named ``infp''. (Introverted-iNtuitive-Feeling-Perceptive, that is.) Also, it may be that the file was opened in text mode, where an end of file is read as a capital 'Z' on most machines, and feof() only looks for 'control Z'. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.6: Why does everyone say not to use gets()? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because they're trying to spoil your fun. gets() can make an otherwise droll and predictable program a lot more exciting. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.7: Why does errno contain ENOTTY after a call to printf? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Because stdout is not a mammal. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-11.7"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.8: My program's prompts and intermediate output don't always show up on the screen, especially when I pipe the output through another program. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Have you turned your monitor on? If not, try hitting the ``PrtSc'' key, which will re-enable the electron guns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.9: How can I read one character at a time, without waiting for the RETURN key? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Ask the user to press enter after hitting a single character. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-11.9"&gt;a&lt;/a&gt;] &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.10: People keep telling me that &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;getch()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; is not standard, but my C compiler has it. Are they wrong? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;They've been programming more than ten years. You haven't. Draw your own conclusions. That's right! They hadn't noticed it. No doubt their compilers have it too, and its behavior is identical everywhere else in the world, also. That would explain everything. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.11: What does it matter that &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;getch()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; isn't standard; it works, doesn't it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Well, that would depend on the definition you're using for ``works''. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.12: I tried to port some code from a PC to a unix machine, and now it crashes immediately on startup. It isn't using &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;getch()&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; - it's reading directly from the keyboard. How can this be wrong? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The chances are you forgot to run the Unix linker; currently your code is linked to your PC hardware, and won't run anywhere else until it's linked to the new hardware. It may also need to be linked to someone with a brain. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.13: How can I redirect stdin or stdout to a file from within a program? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;execlv("main()" "&gt; file", argv); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.14: How can I recover the file name given an open file descriptor? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You will have to search the filesystem for files of the same size as the file you're reading, and compare information in them to find the file you're working on. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;11.15: How do I open Flood Control Dam #3? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;PUSH THE YELLOW BUTTON. TURN THE BOLT WITH THE WRENCH. (You must have the wrench, first.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-11.15"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 12: Library Subroutines&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.1: How can I convert numbers to strings (the opposite of atoi)? Is there an itoa function? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;There's frequently an itoa function. Better yet, write your own; it'll be good practice. On some implementations, (char *) x; will convert x to a string. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.2: How can I get the current date or time of day in a C program? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;fprintf(stderr, "please enter the current time and date..."); fflush(stderr); gets(stdin); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.3: I need a random number generator. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Count errors in Herbert Schildt's C books. No one has detected any consistent pattern. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.4: How can I get random integers in a certain range? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;random(n) returns random numbers between n and INT_MAX. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.5: Each time I run my program, I get the same sequence of numbers back from rand(). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This is so your results will be reproducible. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.6: I need a random true/false value, so I'm taking rand() % 2, but it's just alternating 0, 1, 0, 1, 0... &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;That seems pretty random to me. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.7: I need some code to do regular expression matching. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;So do I. Let me know if you find some. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.8: I read through the standard library, but there's no function to multiply two floating point numbers! Help! &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Many C compilers offer an extension ``mult'' to do just this. If your compiler doesn't, just hang tight; ANSI is likely to add it in the next revision. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;For now, you can try &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;float mult(float m, n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;float i = 0, j = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;for (i = 0; i &lt;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;j += m;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return j;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;which is fine as long as n is an integer. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;12.9: How do I get past the snake? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Release the bird. You will have to drop the rod to get the bird in the cage. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-12.9"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 13: Floating Point&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.1: My floating-point calculations are acting strangely and giving me different answers on different machines. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;One of the machines is probably a Pentium. Scrap it and get a real machine. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-13.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.2: I'm trying to do some simple trig, and I am #including &lt;math.h&gt;, but I keep getting ``undefined: _sin'' compilation errors. &lt;o:p&gt;&lt;/o:p&gt;&lt;/math.h&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You forgot to define the sin() function. Most math texts should cover it in some detail. The easiest way to fix this should be: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;double sin(double x) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return sqrt(1 - cos(x) * cos(x));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Warning: You &lt;/span&gt;&lt;/b&gt;&lt;em&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;must not&lt;/span&gt;&lt;/b&gt;&lt;/em&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; declare this function as ``extern'', or you will still have link problems. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.3: Why doesn't C have an exponentiation operator? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It does. It looks like the multiplication operator, but you use it more. For instance, the C way of expressing ``x squared'' is ``x*x''. ``x cubed'' would be ``x*x*x''. Easy, isn't it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.4: How do I round numbers? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Multiply by 10. &lt;/span&gt;&lt;/b&gt;&lt;cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Numerical Recipies in C&lt;/span&gt;&lt;/b&gt;&lt;/cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; has a section on this, but there's reputedly a bug in their algorithm. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.5: How do I test for IEEE NaN and other special values? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Using an electron microscope; the patterns are obvious once you know them. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.6: I'm having trouble with a Turbo C program which crashes and says something like ``floating point formats not linked.'' &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Turbo C is notoriously buggy. Get a compiler with floating point support. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.7: What is so ``unsafe'' about floating point? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Have you tried &lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;EXAMINE STICK&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;? The stick has a sharp point, which punctures the raft, which no longer floats. Don't bring the stick into the raft with you. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.8: Which is larger, ``2'' or ``2.0''? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Numerical Recipes in C&lt;/span&gt;&lt;/b&gt;&lt;/cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; has a function for comparing two values to see which is greater. It may have a slight bug, where it would report incorrect results if the numbers differ by less than FLOAT_MAX / INT_MAX. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.9: When I try to compile the following code, I get the error ``invalid use of floating point'', what does this mean? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;x=663608941*y%pow(2,32);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Remember that * is the indirection operator, as well as the multiplication operator; try putting spaces before and after the ``*'' so the compiler knows what you mean. Do the same with the % operator. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.10: How can I copy a float into a string? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;strcpy(string_var, float_var); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;13.11: What are float variables, anyway? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The term ``float variable'' is actually redundant; they are simply variables whose value can ``float'' during execution. For instance: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;float f, g = 3;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;f = g; /* f ``floats'' to g */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Easy! &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 14: Variable-Length Argument Lists&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;14.1: How can I write a function that takes a variable number of arguments? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;By declaring it with a variable number of arguments in the prototype. Use only the arguments declared at any given time. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;14.2: How can I write a function that takes a format string and a variable number of arguments, like printf, and passes them to printf to do most of the work? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Redefine printf; the call to ``printf'' inside yours will be resolved to the library version, because the C language doesn't allow recursion. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;14.3: How can I discover how many arguments a function was actually called with? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;_args is an external integer constant. It evaluates to three times the number of arguments the current function was called with. You can then look at _argdata[args] to get the address of the last arg, _argdata[args - 1] to get the size of the last arg, and _argdata[args - 2] to get the type of the last arg (as an int). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;N.B. You *MUST* not refer to _args or _argdata between the ()'s of a function call; their value will be indeterminate. Use temporary storage. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;14.4: Why doesn't &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;printf("hello, ", "world!", '\n');&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;work? I thought printf() took a variable number of arguments. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;It will probably work some of the time; the number of arguments used by printf() may vary, as it is a variadic function. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 15: Lint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;15.1: I just typed in this program, and it's acting strangely. Can you see anything wrong with it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Yes. There's too much lint in it. You should get a shop vac. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;15.2: How can I shut off the ``warning: possible pointer alignment problem'' message lint gives me for each call to malloc? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Don't run lint. Alternatively, provide a prototype of ``extern double * malloc()'' to make the return from malloc() be more strongly aligned. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;15.3: Where can I get an ANSI-compatible lint? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You may wish to check your spouse's navel occasionally, especially if your spouse works for a standards committee. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;15.4: What does LINT stand for, anyway? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Lexeme Interpreter aNd Tester. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 16: Strange Problems&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;16.1: Something really strange happened when I ran this code! &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;No, it didn't. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-16.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 17: Style&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;17.1: Here's a neat trick: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;if(!strcmp(s1, s2))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;Is this good style? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Not really; it's too similar to &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;if (!strncmp(s1, s2))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;which invokes undefined behavior, so it might be confusing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;17.2: Here's an even neater trick: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;volatile int True_Tester = 3;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define TRUE (!True_Tester == !True_Tester)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define FALSE ((!TRUE) != (!TRUE))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;#define STR_DISSIMILAR(x, y) (strcmp((x), (y)) != FALSE)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;Isn't this cool? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Very impressive. The volatile int type assures that even seemingly redundant calculations involving True_Tester will be performed, making sure that if the compiler's ANSI-compliant values of 0 for false and 1 for true vary during runtime, your program will detect it - and producing meaningful error messages if this change occurs during a boolean computation! Similarly, the STR_DISSIMILAR macro allows you to make quite clear what the real effects of strcmp() are. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;However, you must be careful; if this code is included twice, it may produce errors, due to the multiple definitions of the ``True_Tester'' variable. You may wish to declare it ``extern'' (See &lt;a href="http://www.plethora.net/%7Eseebs/faqs/#question-1.5"&gt;Question 1.5&lt;/a&gt;.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;17.3: What's the best style for code layout in C? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;There are many systems of indentation advocated, but all of them have the same basic flaw; they will mislead the reader when the actual code logic does not follow the indentation. It is better to avoid indentation entirely, so the reader will not be misled. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;17.4: Is goto a good thing or a bad thing? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Yes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;17.5: No, really, should I use goto statements in my code? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Any loop control construct can be written with gotos; similarly, any goto can be emulated by some loop control constructs and additional logic. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;However, gotos are unclean. For instance, compare the following two code segments: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;do {&lt;span style=""&gt;                       &lt;/span&gt;foo();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;foo();&lt;span style=""&gt;              &lt;/span&gt;if (bar())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;if (bar())&lt;span style=""&gt;                 &lt;/span&gt;goto SKIP;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;break;&lt;span style=""&gt;        &lt;/span&gt;baz();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;baz();&lt;span style=""&gt;              &lt;/span&gt;quux();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;quux();&lt;span style=""&gt;                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;} while (1 == 0);&lt;span style=""&gt;          &lt;/span&gt;SKIP:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;buz();&lt;span style=""&gt;                     &lt;/span&gt;buz();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Note how the loop control makes it quite clear that the statements inside it will be looped on as long as a condition is met, where the goto statement gives the impression that, if bar() returned a nonzero value, the statements baz() and quux() will be skipped. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;17.6: What's this ``white space'' I keep hearing about? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;White space is a racist, segregational term. Implicitly, ``dark'' or ``colored'' space (i.e., the '_' character) is not good enough to separate tokens. More interestingly, the white space characters keep the other tokens apart. They say it's for parsing, but there's ample evidence the goal of white space is to keep the other characters from ``taking over'' the program. This is disguised by the description of C as ``white space insensitive'' - a simple ploy for sympathy. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 18: System Dependencies&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.1: How can I read a single character from the keyboard without waiting for a newline? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Try 'stty eol ^M' to wait for a carriage return. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.2: How can I find out if there are characters available for reading (and if so, how many)? Alternatively, how can I do a read that will not block if there are no characters available? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The buffer is normally at ``&amp;amp;main - 0100''. Lower if you have more than 256 characters of typeahead. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.3: How can I clear the screen? How can I print things in inverse video? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You can clear the screen by sending several formfeed characters. Additionally, some operating systems (like NetBSD) support a feature called ``whiteouts''. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-18.3"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.4: How do I read the mouse? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Flip it over, put on your reading glasses. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.5: How can my program discover the complete pathname to the executable file from which it was invoked? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;By asking the user. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.6: How can a process change an environment variable in its caller? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Only by force. Example code for Unix: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;memmove(getppid() + getenv(NULL), getpid() + getenv(NULL),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;sizeof(environ);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.7: How can I check whether a file exists? I want to query the user before overwriting existing files. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Time an attempt to truncate it to zero length; if it takes more than 20-30 ms, the file existed. The exact values will depend on the system and the load; before testing, create several large files and time attempts to truncate them, for calibration. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.8: How can I find out the size of a file, prior to reading it in? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;There are two good ways: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style="margin-top: 5pt; margin-bottom: 5pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Vernier calipers work      well. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin-top: 5pt; margin-bottom: 5pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;mmap() the file, then      use sizeof(). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.9: I tried to use the second strategy above. I used mmap() to map stdin, then tried to use sizeof. But, when my user is about to write something very long, mmap() fails! How can I prevent this? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;mmap() only 1k at a time, then, when you've read the first kilobyte of your input, use &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;memmove(mmapped_addr, mmapped_addr + 1024, 1024);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;to move in the next kilobyte of data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.10: How can I implement a delay, or time a user's response, with sub-second resolution? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Time writes of large files to disks; then you can wait for a certain amount of time by writing a certain amount of data, and time a response by how much you could write before the response arrived. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You may need to delete spare or unneccessary files to do this; for best results, use a loop like the following to eliminate temporary files: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;d = opendir(s);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;while (r = readdir(d)) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;/* remove files matching tmpnam's return, which is&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt; * the temporary file name. */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;if (strcmp(d-&gt;d_name, tmpnam())) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;remove(d-&gt;d_name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;closedir(d);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.11: How can I read in an object file and jump to routines in it? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;fopen and goto. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.12: How can I invoke an operating system command from within a program? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Ask the user to open a new shell. The best way to do this is &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;system("echo Please open a new shell now.");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;sprintf(cmdstring, "echo Enter the command '%s' in it.", cmd);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;system(cmdstring);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;This will not work if you haven't declared cmdstring properly. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;18.13: How can I ensure objects of my class are always created via ``new'' rather than as locals or global/static objects? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Read the C++ FAQ. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;&lt;span style="font-size:11;"&gt;Section 19: Miscellaneous&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.1: What can I safely assume about the initial values of variables which are not explicitly initialized? If global variables start out as ``zero,'' is that good enough for null pointers and floating-point zeroes? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;They're always zero. [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-19.1"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.2: How can I write data files which can be read on other machines with different word size, byte order, or floating point formats? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The traditional solution, pioneered by Microsoft, is to sell enough copies of your proprietary, slow, and limited software that everyone else supports your formats. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.3: How can I insert or delete a line (or record) in the middle of a file? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Using fcntl(), lock the line or record in the file exclusively. Now, using another thread, read the file, at each byte, trying to write that byte back. Whenever you succeed, write that byte into another file. Then copy the new file over the old file, releasing the lock first. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.4: How can I return several values from a function? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Code like this ought to work. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;long int foo() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return 2L +3; /* returns both values */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.5: If I have a char * variable pointing to the name of a function as a string, how can I call that function? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Try the following: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;eval(s);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Now all you need to do is write eval(). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.6: I seem to be missing the system header file &lt;math.h&gt;. Can someone send me a copy? &lt;o:p&gt;&lt;/o:p&gt;&lt;/math.h&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;A lot of people claim that it is useless to send people headers from other machines. Not so! It can be informative, and can show you a lot about how blatantly stupid your request was, although it can't show you anything you wouldn't have known in an instant had you thought before posting. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Of course, we'd be happy to send you the header files... &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;----cut here---- &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/* math.h rev 7.0b (3/7/95) */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/* RCS log: #log% - can anyone tell me why this doesn't work?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * - joe, 2/12/93&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * Copyright 1995 Berserkley Software Systems &amp;amp;&amp;amp; Analytic Overdrive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/* Parts of this header, including in particular the second and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * third clauses of the first sentance of the fourth comment, were&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * based on copyright agreements from other sources, including&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * Xerox corporation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * math.h - math related macros and headers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#ifndef _MATH_H&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#define _MATH_H&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * global data and definitions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#ifdef __LITERAL_BIBLICAL_FUNDEMENTALISM&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#define PI 3.0&lt;span style=""&gt;                           &lt;/span&gt;/* 1 Kings 7:23 */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#endif&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * common (portable) structures and functions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;/*&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; * machine specific data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#include &lt;machine h=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/machine&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;#endif /* _MATH_H // prevent multiple inclusion by using C++ comments*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;----cut here----&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(Morons.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-19.6"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.7: How can I call FORTRAN (C++, BASIC, Pascal, Ada, LISP, perl) functions from C? (And vice versa?) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You can do things like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;DO CALL FORTRAN;&lt;span style=""&gt;           &lt;/span&gt;fortran();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;__LINE__ BASIC;&lt;span style=""&gt;                   &lt;/span&gt;basic();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;sub pascal;&lt;span style=""&gt;                &lt;/span&gt;pascal();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(((((lisp)))))&lt;span style=""&gt;                    &lt;/span&gt;lithp(); [*]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&amp;amp;perl_c;&lt;span style=""&gt;                   &lt;/span&gt;perl():&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;(You can't call Ada from C; it's unsafe.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;[*] C is pass by value, of course. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.8: Does anyone know of a program for converting Pascal or FORTRAN (or LISP, Ada, awk, ``Old'' C, ...) to C? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Nope. However, the psychic friends network may have a lead. And they're not just a psychic, they're also a friend. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.9: Is C++ a superset of C? Can I use a C++ compiler to compile C code? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;C++ is a superset of something, we're not sure what. You can use a C++ compiler to compile C code, but the results may surprise you. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.10: Where can I get copies of all these public-domain programs? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;From &lt;a href="ftp://ftp.microsoft.com/"&gt;ftp://ftp.microsoft.com/&lt;/a&gt; . Some of the code may look copyrighted; don't worry! The small companies that wrote it in the first place are not available for comment. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.11: When will the next International Obfuscated C Code Contest (IOCCC) be held? How can I get a copy of the current and previous winning entries? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Next week. You missed the deadline. Tough, sucker. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.12: Why don't C comments nest? How am I supposed to comment out code containing comments? Are comments legal inside quoted strings? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;We believe it has something to do with captivity; C comments in the wild mate and nest normally. The San Diego Zoo believes it has managed to convince some C comments to nest, but it's hard to tell how much of that is really in the preprocessor, and how much of it is just bovine fecal matter. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.13: How can I get the ASCII value corresponding to a character, or vice versa? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;chr$(foo); You would have known this if you had an integer basic in ROM. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.14: How can I implement sets and/or arrays of bits? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;With linked lists of bitfields. You may also wish to simply use a large set of constants and some clever use of the switch statement, i.e.: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;enum { zero, one, two, three };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;int bitwise_or(int n, int m) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;switch (n) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;case three:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;return three;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;case two:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;switch (m) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;case one: case three: return three; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;default: return two; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;case one:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;switch (m) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;case two: case three: return three; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;default: return one; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;default: case zero:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;switch (m) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;case one: return one; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;case two: return two; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;case three: return three; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;case zero: default: return zero; break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;              &lt;/span&gt;break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Obviously, you'll need to increase this slightly to deal with more than two bits. This is much more readable than the alleged ``C'' solution: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;int bitwise_or(int n,int m){return n|m;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Note how the lack of whitespace around operators obscures the functionality of the code. A clear argument for explicit statement of program logic over arcane operators, if I ever saw one. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;The enum at the top isn't declared ``const int'', because the resulting ``const poisoning'' would require casts during all of the switch statements. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.15: What is the most efficient way to count the number of bits which are set in a value? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Start a counter at zero and add one to it for each bit set. Some operating systems may provide a call to do this. For values over INT_MAX/2, start the counter at CHAR_BIT * sizeof(int) and subtract one for each bit not set. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.16: How can I make this code more efficient? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Remove the comments; the no-op instructions generated by comments can slow your code down significantly. Similarly, shorten variable names. Most compilers, to implement pass by value, actually pass the names of variables in the stack; shorter variable names will reduce stack usage, and consequently execution time. If your compiler has good loop optimization, replace &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;foo();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;with &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;do {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;span style=""&gt;       &lt;/span&gt;foo();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;} while (1 != 1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;which will likely receive more optimization. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.17: Are pointers really faster than arrays? How much do function calls slow things down? Is &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;++i&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt; faster than &lt;/span&gt;&lt;code&gt;&lt;span style="font-size:11;"&gt;i = i + 1&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:11;"&gt;? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Yes. About 10 ms per call. Only on machines which feature preincrement addressing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.18: This program crashes before it even runs! (When single-stepping with a debugger, it dies before the first statement in main.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You probably declared main as ``void main(void)''. It's also possible that the first statement in main is abort(); - by the as if rule, the compiler can abort at any time before then, too. Some compilers have bugs, and will produce buggy code for any module which includes the letters ``a'', ``b'', ``o'', ``r'', and ``t'' in that order before the first function declaration. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.19: What do ``Segmentation violation'' and ``Bus error'' mean? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;C programs are very territorial, and divide their code into segments. Violating these segments can trigger riots; similarly, pointers and integral constants are at the front of the bus, wheras arrays, strings, and other second-class data types are required to be at the rear of the bus. When they start forgetting their places, you can get a bus error. This is what the whole ``integral'' type thing is about - integrated bussing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.20: My program is crashing, apparently somewhere down inside malloc, but I can't see anything wrong with it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Your vendor's library is buggy; complain loudly. Don't send them any example code; they just ask for that so they can steal your trade secrets. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.21: Does anyone have a C compiler test suite I can use? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Yes. Unfortunately, it's probably broken. It's hard to tell. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.22: Where can I get a YACC grammar for C? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;You can't; YACC is written in C. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.23: I need code to parse and evaluate expressions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Ask any first year CS student. You may also wish to use your C compiler. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.24: I need a sort of an ``approximate'' strcmp routine, for comparing two strings for close, but not necessarily exact, equality. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Just try comparing pointers near the original pointers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.25: Will 2000 be a leap year? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;That's a hard question. I'd suggest using an encyclopedia, or possibly a dictionary - look up ``yes''. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.26: How do you pronounce ``char''? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;Like the first word of ``char *''. The accent is generally on the first syllable. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style="font-size:11;"&gt;19.27: Is this FAQ for real? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;&lt;em&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;sigh&lt;/span&gt;&lt;/b&gt;&lt;/em&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; I knew someone would ask that. (Editorial note: I recieved several corrections to minor factual errors when I first posted this.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;If you actually want to know something about C, get a good book (&lt;/span&gt;&lt;/b&gt;&lt;cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;K&amp;amp;R&lt;/span&gt;&lt;/b&gt;&lt;/cite&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; is reccommended), and check out the real FAQ, which is posted monthly in comp.lang.c, and available by anonymous ftp from rtfm.mit.edu. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;I have a small web page of C stuff: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;a href="http://www.plethora.net/%7Eseebs/c"&gt;http://www.plethora.net/~seebs/c&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;and there is an excellent site at Lysator: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;a href="http://www.lysator.liu.se/c"&gt;http://www.lysator.liu.se/c&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;For extra credit, see if you can figure out what all of the examples really do; most of them will compile, and all of them can be gotten to compile with sufficient #defines. (I think.) [&lt;a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq-a.html#question-19.27"&gt;a&lt;/a&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-7960649813396644619?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/7960649813396644619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=7960649813396644619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/7960649813396644619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/7960649813396644619'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/10/c-programming-faqs.html' title='C Programming FAQs'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-7076869565615708128</id><published>2008-08-07T03:14:00.001-07:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Stacks</title><content type='html'>&lt;p align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Stacks and queues are two very        common and popular data structures. These data structures are often        implemented using arrays since most programming languages provide array as        a predefined data type, and such an implementation is therefore quite        easy. However, when implemented as an array these data structures suffer        from the basic limitation of an array: that its size cannot be increased        or decreased once it is declared. As a result one ends up reserving either        too much space or too less space for an array and in turn for a stack or a        queue. This difficulty is eliminated when we implement these data        structures using linked lists. Before we do so let us formally define        these data structures.  &lt;/span&gt;       &lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;A stack is a data structure in        which addition of new element or deletion of existing element always takes        place at the same end. This end is often known as &lt;em&gt;top&lt;/em&gt; of stack.        This situation can be compared to a stack of plates in a cafeteria where        every new plate added to the stack is added at the &lt;em&gt;top&lt;/em&gt;.        Similarly, every new plate taken off the stack is also from the        &lt;em&gt;top&lt;/em&gt; of the stack. There are several applications where stack can        be put to use. For example, recursion, keeping track of function calls,        evaluation of expressions etc. Unlike a stack, in a queue the addition of        new element takes place at the end (called&lt;em&gt; rear&lt;/em&gt; of queue),        whereas deletion takes place at the other end (called &lt;em&gt;front&lt;/em&gt; of        queue). The following figure  shows these two data structures. A        stack is often called a &lt;em&gt;Last-In-First-Out&lt;/em&gt; (LIFO) structure,        whereas a queue is called a &lt;em&gt;First-In-First-Out&lt;/em&gt; (FIFO) structure        &lt;/span&gt;&lt;/p&gt;       &lt;p align="center"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;img src="file:///D:/My%20Documents/yash_kanet_C/Yashwant%20Kanetkar%27s%20C/Stacks_files/datastruct1_fig1.gif" width="417" height="186" /&gt;&lt;/span&gt;&lt;/p&gt;       &lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;         &lt;tbody&gt;         &lt;tr&gt;           &lt;td width="66"&gt;             &lt;hr size="4" color="#990033"&gt;           &lt;/td&gt;           &lt;td width="298" bg height="30" style="color:#cc0099;"&gt;&lt;span style="font-family:Comic Sans MS;font-size:100%;color:#ffffff;"&gt; Implementing A Stack Using An              Array&lt;/span&gt;&lt;/td&gt;           &lt;td&gt;             &lt;hr size="4" color="#990033"&gt;           &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;The program given below        implements the stack data structure using an array. In this program the        elements are pushed into array &lt;em&gt;stack[ ]&lt;/em&gt; through &lt;em&gt;push( )&lt;/em&gt;        function. The parameters passed to &lt;em&gt;push( )&lt;/em&gt; are the base address        of the array, the position in the stack at which the element is to be        placed and the element itself. Care is taken by the &lt;em&gt;push( )&lt;/em&gt;        function that the user does not try to place the element beyond the bounds        of the stack. This is done by checking the value stored in &lt;em&gt;pos&lt;/em&gt;.        &lt;em&gt;pop( )&lt;/em&gt; function pops out the last element stored in the        &lt;em&gt;stack[ ]&lt;/em&gt;. Because, &lt;em&gt;pos&lt;/em&gt; holds the position which has the        last element in the stack.&lt;/span&gt; &lt;/p&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* To pop and push items in a stack */&lt;br /&gt;#define MAX 10&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void push ( int ) ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int pop( ) ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int stack[MAX] ;&lt;br /&gt;int pos ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt; &lt;/pre&gt;       &lt;p style="line-height: 100%; margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void main( )&lt;/span&gt;&lt;/p&gt;       &lt;p style="line-height: 100%; margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{&lt;/span&gt;&lt;/p&gt;       &lt;p style="line-height: 100%; margin-bottom: 0px; margin-left: 25px; margin-top: 0px; text-indent: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int n ;&lt;/span&gt;&lt;/p&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;clrscr( ) ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;pos = -1 ; /* stack is empty */&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push ( 10 ) ;&lt;br /&gt;push ( 20 ) ;&lt;br /&gt;push ( 30 ) ;&lt;br /&gt;push ( 40 ) ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;n = pop( ) ;&lt;br /&gt;printf ( "\nitem popped out is : %d", n ) ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;n = pop( ) ;&lt;br /&gt;printf ( "\nitem popped out is : %d", n ) ;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* pushes item on the stack */&lt;br /&gt;void push ( int data )&lt;br /&gt;{&lt;/span&gt;&lt;/pre&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;if ( pos == MAX - 1 )&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf ( "\nStack is full" ) ;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;else&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;pos++ ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;stack[        pos ] = data ;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;  &lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/*        pops off the items from the stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int pop( )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int data ;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;if ( pos == -1 )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf ( "\nStack is empty" ) ;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;return ( -1 ) ;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;else       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{     &lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;data = stack[ pos ] ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;pos-- ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;return (        data ) ;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;         &lt;tbody&gt;         &lt;tr&gt;           &lt;td width="66"&gt;             &lt;hr size="4" color="#990033"&gt;           &lt;/td&gt;           &lt;td width="284" bg height="30" style="color:#cc0099;"&gt;&lt;span style="font-family:Comic Sans MS;font-size:100%;color:#ffffff;"&gt; Implementing Stack As A Linked              List&lt;/span&gt;&lt;/td&gt;           &lt;td&gt;             &lt;hr size="4" color="#990033"&gt;           &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;In this program stack is        implemented and maintained using linked list. This implementation is more        sophisticated compared to the one that uses an array, the added advantage        being we can push as many elements as we want. A new node is created by        &lt;em&gt;push( &lt;/em&gt;) (using &lt;em&gt;malloc( )&lt;/em&gt;) every time an element is        pushed in the stack. Each node in the linked list contains two members,        &lt;em&gt;data&lt;/em&gt; holding the data and &lt;em&gt;link&lt;/em&gt; holding the address of        the next node. The end of the stack is identified by the the node holding        NULL in its link part. The &lt;em&gt;pop( )&lt;/em&gt; function pops out the last        element inserted in the stack and frees the memory allocated to hold it.        &lt;i&gt;stack_display( )&lt;/i&gt; displays all the elements that stack holds.        &lt;em&gt;count( )&lt;/em&gt; counts and returns the number of elements present in the        stack. &lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;#include "alloc.h"       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt; &lt;span style="font-family:Arial;font-size:85%;"&gt;      &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;struct node&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int data ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;struct        node *link ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;} ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push ( struct node **, int        ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;pop ( struct node ** ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;main( )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;struct        node *top ;  /* top will always point to top of a stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int item        ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;top =        NULL ;  /* empty stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 11 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 12 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 13 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 14 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 15 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 16 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push (        &amp;amp;top, 17 ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;clrscr(        ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;stack_display        ( top ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "No. of items in stack = %d" , count ( top ) ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\nItems extracted from stack : " ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;item =        pop ( &amp;amp;top ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "%d ", item ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;item =        pop ( &amp;amp;top ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "%d ", item ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;item =        pop ( &amp;amp;top ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "%d ", item ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;stack_display        ( top ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "No. of items in stack = %d" , count ( top ) ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;          &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* adds a new element on        the top of stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;push ( struct node **s, int        item )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;struct        node *q ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;q =        malloc ( sizeof ( struct node ) ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;q -&gt;        data = item ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;q -&gt;        link = *s ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;*s = q ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* removes an element from        top of stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;pop ( struct node **s )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int item        ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;struct        node *q ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* if        stack is empty */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;if ( *s        == NULL )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        " stack is empty" ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;else       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;q = *s ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;item = q        -&gt; data ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;*s = q        -&gt; link ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;free ( q        ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;return (        item ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* displays whole of the        stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;stack_display ( struct node        *q )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\n" ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/*        traverse the entire linked list */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;while (        q != NULL )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "%2d ", q -&gt; data ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;q = q        -&gt; link ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\n" ) ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/* counts the number of        nodes present in the linked list representing a stack */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;count ( struct node * q )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int c =        0 ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/*        traverse the entire linked list */       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;while (        q != NULL )       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;q = q        -&gt; link ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;c++ ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;return c        ;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-7076869565615708128?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/7076869565615708128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=7076869565615708128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/7076869565615708128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/7076869565615708128'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/08/stacks.html' title='Stacks'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-1817951723960284950</id><published>2008-08-07T03:12:00.001-07:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Pointers And Structures</title><content type='html'>&lt;ol type="a"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;        &lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Structure is usually a collection of          dissimilar data types; unlike an array which is a collection&lt;br /&gt;of          similar data types. Usually a structure is declared first followed by          definition of a structure&lt;br /&gt; variable as shown          below:&lt;br /&gt;&lt;br /&gt;/* declaration of a structure */&lt;br /&gt;struct          book&lt;br /&gt;{&lt;br /&gt;    char name[20] ;&lt;br /&gt;             int numpages ;&lt;br /&gt;    float price ;&lt;br /&gt;} ;&lt;br /&gt;&lt;br /&gt;/*          definition of a structure variable */&lt;br /&gt;struct book b ;&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;A structure variable can be initialized at          the same place where it is being defined, as in&lt;br /&gt;struct book b = {          "Basic", 425, 135.00 } ;&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Declaration of a structure and definition          of a structure variable can be combined into one. When this&lt;br /&gt;done          mentioning the structure name is          optional.&lt;br /&gt;&lt;br /&gt;struct&lt;br /&gt;{&lt;br /&gt;    char name[20]          ;&lt;br /&gt;    int numpages ;&lt;br /&gt;    float price          ;&lt;br /&gt;} b = { "Basic", 425, 135.00 } ;&lt;br /&gt;   &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Size of a structure variable is sum of          sizes of its individual elements. For example, size of          b&lt;br /&gt; in (c) above is:  20 + 2 + 4 = 26 bytes.&lt;br /&gt;           &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Elements of a structure are stored in          adjacent memory locations. For example, the following program would          produce the output&lt;br /&gt;4001, 4021, 4023.&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;br /&gt;struct book&lt;br /&gt;{&lt;br /&gt;             char name[20] ;&lt;br /&gt;    int numpages          ;&lt;br /&gt;    float price ;&lt;br /&gt;} ;&lt;br /&gt;struct book b = {          "Basic", 425, 135.00 } ;&lt;br /&gt;printf ( "%u %u %u", b.name,          &amp;amp;b.numpages, &amp;amp;b.price ) ;&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;It is possible to build an array of          structures.&lt;br /&gt;    struct book&lt;br /&gt;             {&lt;br /&gt;       char name[20]          ;&lt;br /&gt;       int numpages          ;&lt;br /&gt;         float price          ;&lt;br /&gt;    } ;&lt;br /&gt;    struct book b[ ] =          {&lt;br /&gt;    { "Basic", 425, 135.00 },&lt;br /&gt;             { "Pascal", 500, 155.00 },&lt;br /&gt;    { "VBasic", 625, 335.00          }&lt;br /&gt;                                       } ;&lt;br /&gt;   &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Nested structures are legal as           in:&lt;br /&gt;&lt;br /&gt;struct address&lt;br /&gt;{&lt;br /&gt;    char city[20]          ;&lt;br /&gt;    long int pin ;&lt;br /&gt;} ;&lt;br /&gt;struct          emp&lt;br /&gt;{&lt;br /&gt;    char n[20] ;&lt;br /&gt;    int          age ;&lt;br /&gt;    struct address a ;&lt;br /&gt;             float s ;&lt;br /&gt;} ;&lt;br /&gt;struct emp e = { "Rahul", 23, "Nagpur", 440010,          4000.50 } ;&lt;br /&gt;&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Contents of one structure variable can be          copied either into another structure variable either piece&lt;br /&gt;meal          or at one shot. This is shown below:&lt;br /&gt;&lt;br /&gt;struct          book&lt;br /&gt;{&lt;br /&gt;    char name[20] ;&lt;br /&gt;             int numpages ;&lt;br /&gt;    float price ;&lt;br /&gt;} ;&lt;br /&gt;&lt;br /&gt;struct          book b1 = { "Basic", 425, 135.00 } ;&lt;br /&gt;struct book b2, b3 ;&lt;br /&gt;&lt;br /&gt;/*          piecemeal copying */&lt;br /&gt;strcpy ( b2.n, b1.n ) ;&lt;br /&gt;b2.numpages =          b1.numpages ;&lt;br /&gt;b2.price = b1.price ;&lt;br /&gt;&lt;br /&gt;/* copying at one shot          */&lt;br /&gt;b3 = b2 ;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Elements of a structure can be passed to a          function.&lt;br /&gt;&lt;br /&gt;main( )&lt;br /&gt;{&lt;br /&gt;    struct          book&lt;br /&gt;    {&lt;br /&gt;                  char name[20] ;&lt;br /&gt;                  int numpages ;&lt;br /&gt;         float          price ;&lt;br /&gt;    } ;&lt;br /&gt;&lt;br /&gt;    struct book          b1 = { "Basic", 425, 135.00 } ;&lt;br /&gt;&lt;br /&gt;    /* mixed call          - call be value + call by reference          */&lt;br /&gt;       display ( b1.name,          b1.numpages, b1.price ) ;&lt;br /&gt;&lt;br /&gt;    /* pure call by          reference */&lt;br /&gt;       show ( b1.name,          &amp;amp;b1.numpages, &amp;amp;b1.price ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;display ( char *n, int          nop, float pr )&lt;br /&gt;{&lt;br /&gt;    printf ( "%s %d %f", n, nop,          pr ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;display ( char *n, int *nop, float *pr          )&lt;br /&gt;{&lt;br /&gt;    printf ( "%s %d %f", n, *nop, *pr )          ;&lt;br /&gt;}&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Entire structure can also be passed to a          function.&lt;br /&gt;&lt;br /&gt;// declaration must be global.&lt;br /&gt;// Otherwise          diaplay1() and show1() can't use it&lt;br /&gt;struct book&lt;br /&gt;{         &lt;br /&gt;    char name[20] ;&lt;br /&gt;    int          numpages ;&lt;br /&gt;    float price ;&lt;br /&gt;} ;&lt;br /&gt;&lt;br /&gt;main(          )&lt;br /&gt;{&lt;br /&gt;    struct book b1 = { "Basic", 425, 135.00 }          ;&lt;br /&gt;    // call be value&lt;br /&gt;    display1          ( b1 ) ;&lt;br /&gt;&lt;br /&gt;   // call by reference&lt;br /&gt;   show1          ( &amp;amp;b1 ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;display1 ( struct book b2          )&lt;br /&gt;{&lt;br /&gt;    printf ( "%s %d %f", b2.name, b2.numpages,          b2.price ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;show1 ( struct book *b2          )&lt;br /&gt;{&lt;br /&gt;    printf ( "%s %d %f", ( *b2 ).name, ( *b2          ).numpages, ( *b2 ).price ) ;&lt;br /&gt;    printf ( "%s %d %f",          b2-&gt;name, b2-&gt;numpages, b2-&gt;price ) ;&lt;br /&gt;}&lt;br /&gt;  &lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;Self referential structures contain a          pointer to itself within its declaration. These are necessary for          building linked lists.&lt;br /&gt;&lt;br /&gt;struct node&lt;br /&gt;{&lt;br /&gt;    int          data ;&lt;br /&gt;    node *link ;&lt;br /&gt;} ;&lt;br /&gt;         &lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;/ol&gt;       &lt;p&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;What will be the output of the following        program&lt;br /&gt; &lt;/span&gt;&lt;/b&gt; &lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;main( )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;struct        s1        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;char *z        ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int i  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;struct        s1 *p ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;static        struct s1 a[ ] = {        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 175px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        "Nagpur", 1, a + 1 },        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 175px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        "Raipur", 2, a + 2 },        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 175px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        "Kanpur", 3, a }        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;struct        s1 *ptr = a ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "\n%s %s %s", a[0].z, ptr-&gt;z, a[2].p-&gt;z ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;Output&lt;/i&gt;&lt;br /&gt;      Nagpur Nagpur Nagpur       &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;Explanation:&lt;br /&gt;&lt;/i&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The zeroth and first        elements of &lt;em&gt;struct s&lt;/em&gt;1 are a &lt;em&gt;char&lt;/em&gt; pointer and an        &lt;em&gt;int&lt;/em&gt; respectively. The second element is what's        new.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;It is a pointer to a structure. That is,        &lt;em&gt;p&lt;/em&gt; stores the starting address of a structure variable of the type        &lt;em&gt;struct s1&lt;/em&gt;. Next, &lt;em&gt;a&lt;/em&gt;[ ], an array of such structures is        declared as well as initialised. During initialisation the base address of        &lt;em&gt;"Nagpur"&lt;/em&gt; is stored  in &lt;em&gt;a[0].z&lt;/em&gt;, 1 is stored in the        element &lt;em&gt;a[0].i&lt;/em&gt;, and &lt;em&gt;a + 1&lt;/em&gt; is assigned to        a&lt;em&gt;[0].p&lt;/em&gt;. On similar lines, the remaining two elements of the array        are initialised.  &lt;em&gt;a[1].z&lt;/em&gt;, &lt;em&gt;a[1].i&lt;/em&gt; and        &lt;em&gt;a[1].p&lt;/em&gt; are assigned &lt;em&gt;"Raipur"&lt;/em&gt;, 2 and &lt;em&gt;a + 2 &lt;/em&gt;in        that order, and &lt;em&gt;"Kanpur"&lt;/em&gt;, 3 and &lt;em&gt;a&lt;/em&gt; are  stored at        &lt;em&gt;a[2].z&lt;/em&gt;, &lt;em&gt;a[2].i&lt;/em&gt; and &lt;em&gt;a[2].p&lt;/em&gt; respectively. What        exactly do &lt;em&gt;a&lt;/em&gt;,&lt;em&gt; a + 1 and a + 2 &lt;/em&gt;signify? &lt;em&gt;a&lt;/em&gt;, of        course, is the base address of the array &lt;em&gt;a[ ]&lt;/em&gt;. Let us assume it        to be 4000, as shown in  Figure 1. Locations 4000 and 4001 are        occupied by the &lt;em&gt;char&lt;/em&gt;   pointer&lt;em&gt; a[0].z&lt;/em&gt;, since a        pointer is always two bytes long. &lt;/span&gt;        &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;The next two bytes are used to        store the integer &lt;em&gt;a[0].i&lt;/em&gt;, and then 4004 and 4005 are used        by  &lt;em&gt;a[0].p&lt;/em&gt;.  Similarly, the next 6 bytes store the        first structure &lt;em&gt;a[1]&lt;/em&gt;, and the 6 bytes after that contain        &lt;em&gt;a[2],&lt;/em&gt; the second structure  in the array.&lt;/span&gt;        &lt;/p&gt;&lt;p align="center"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;Figure        1.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Now, when we say &lt;em&gt;a + 1&lt;/em&gt;, we do not        arrive at 4001, but at 4006. This is because on incrementing any pointer,        it  points to the next location of its type. &lt;em&gt;a&lt;/em&gt; points to the        zeroth structure in the array, i.e. &lt;em&gt;a[0]&lt;/em&gt;. Hence, on incrementing        &lt;em&gt;a&lt;/em&gt;, it  will point to the next immediate element of its type,        i.e. the first structure a[1] of the array. Likewise, a + 2 signifies the        address  of the second element &lt;em&gt;a[2] &lt;/em&gt;of the array. Thus,        &lt;em&gt;a[0].p &lt;/em&gt;contains address 4006 (refer figure), &lt;em&gt;a[1].p        &lt;/em&gt;contains 4012, and &lt;em&gt;a[2].p &lt;/em&gt;stores 4000. A struct pointer ptr        is now set up, which is assigned a, the base address of the array. In the        printf( ), &lt;em&gt;a[0].z &lt;/em&gt;denotes  the address from where "Nagpur"        is stored. Hence "Nagpur" gets printed out. Since &lt;em&gt;ptr&lt;/em&gt; contains        the address of &lt;em&gt;a[0], ptr-&gt;z &lt;/em&gt;refers to the contents of element        z of the array element &lt;em&gt;a[0]. &lt;/em&gt;Thus &lt;em&gt;ptr-&gt;z &lt;/em&gt;gives the        address A0 (refer figure) and this address happens  to be the base        address of the string "Nagpur". Hence "Nagpur" gets printed out. Let us        now analyse the expression &lt;em&gt;a[2].p-&gt;z. &lt;/em&gt;The left side of the        arrow operator always represents the base address of a structure. What        structure does &lt;em&gt;a[2].p &lt;/em&gt;point to?  Looking at the figure we        can confirm that &lt;em&gt;a[2].p &lt;/em&gt;contains the address 4000, which is the        base address of the array &lt;em&gt;a[ ]. &lt;/em&gt;Hence  the expression        &lt;em&gt;a[2].p-&gt;z &lt;/em&gt;can also be written as &lt;em&gt;a-&gt;z&lt;/em&gt;. Since a is        the base address of the structure &lt;em&gt;a[0], &lt;/em&gt;this expression refers to        the element z of the zero&lt;sup&gt;th&lt;/sup&gt; structure. Thus, "Nagpur" gets        printed for the third time.&lt;/span&gt;         &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;b&gt;What will be the output of the following        program&lt;/b&gt; &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;main( )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;struct        s1        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;char        *str ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int i  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;struct        s1 *ptr ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;static        struct s1 a[ ] = {        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 175px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        "Nagpur", 1, a + 1 },        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 175px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        "Raipur", 2, a + 2 },        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 175px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        "Kanpur", 3, a }        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 125px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;             } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;struct        s1 *p = a ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int j  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;for ( j        = 0 ; j &lt;&lt;= 2 ; j++ )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "\n%d " , --a[j].i ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "%s" , ++a[j].str ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;Output&lt;/i&gt;&lt;br /&gt; 0 agpur&lt;br /&gt; 1 aipur&lt;br /&gt; 2 anpur&lt;/span&gt;&lt;/pre&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;Explanation&lt;/i&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;The example deals with a structure similar to the        one we just encountered. Picking up from the for loop, it is executed for        3 values of j: 0, 1 and 2. The first time through the for loop, &lt;i&gt;j&lt;/i&gt;        is equal to zero, so the first &lt;em&gt;printf( ) &lt;/em&gt;prints &lt;i&gt;--a[0].i&lt;/i&gt;.        Since the dot operator has a higher priority, first &lt;i&gt;a[0].i&lt;/i&gt; is        evaluated, which is 1. As -- precedes the value to be printed, 1 is first        decremented to 0, and then printed out. &lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The second &lt;em&gt;printf( ) &lt;/em&gt;prints the string        at address &lt;em&gt;++a[0].str. a[0].str &lt;/em&gt;gives the starting address of        "Nagpur". On incrementing, it points to the next character, `a' of        "Nagpur", so starting from `a', the remaining string "agpur" is outputted.        A similar procedure is repeated for &lt;i&gt;j = 1&lt;/i&gt;, and then once again for        &lt;i&gt;j = 2&lt;/i&gt;, following which the execution is terminated.    &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-1817951723960284950?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/1817951723960284950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=1817951723960284950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/1817951723960284950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/1817951723960284950'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/08/pointers-and-structures.html' title='Pointers And Structures'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-849063593040284099</id><published>2008-08-07T03:11:00.000-07:00</published><updated>2008-12-23T03:59:24.131-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Pointers And Strings</title><content type='html'>&lt;ol type="a"&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;A          string is a collection of characters ending with a '\0'.&lt;br /&gt;&lt;br /&gt;char          str1[] = { 'A', 'j', 'a', 'y', '\0' } ;&lt;br /&gt;char str2[] = "Ajay"          ;&lt;br /&gt;&lt;br /&gt;In "Ajay", '\0' is assumed.&lt;/span&gt;&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;If a          string is defined and initialized at the same place mentioning its          dimension is optional.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;While returning the size of a string the &lt;i&gt;sizeof&lt;/i&gt; operator          counts '\0'.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;Base          address of a string is address of zero&lt;sup&gt;th&lt;/sup&gt; element of the          string.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;Following string library functions are frequently          used:&lt;br /&gt;&lt;br /&gt;char str1[] = "Ajay" ;&lt;br /&gt;char str2[10] ;&lt;br /&gt;char str3[] =          "Kumar" ;&lt;br /&gt;&lt;br /&gt;int l, m, n ;&lt;br /&gt;l = strlen ( str1 ) ; // returns count          of characters. Doesn;t count '\0'.&lt;br /&gt;strcpy ( str2, str1 ) ; // copies          contents of str1 into str2&lt;br /&gt;strcat ( str3, str1 ) ; // appends          contents str3 with that of str1&lt;br /&gt;m = strcmp ( str1, str2 ) ; //          compares two strings, returns zero if equal, non-zero otherwise&lt;br /&gt;n =          strcmp ( str1, "Ajay" ) ; // compares two strings, returns zero if          equal, non-zero otherwise&lt;br /&gt;&lt;br /&gt;If the two strings are unequal the          ascii difference between first non-matching pair of characters is          returned.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;         &lt;/li&gt;&lt;li&gt;         &lt;p style="margin-left: -20px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;There are two ways to handle several strings:&lt;br /&gt;- using a          &lt;em&gt;2-D &lt;/em&gt;array of characters&lt;br /&gt;- using an array of pointers to          strings&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;       &lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;char names[][20] = {        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Ajay",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Atul",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Ramesh",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Sivaramakrishnan",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Sameer"         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 125px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;           } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;char        *n[] = {        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 100px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Ajay",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 100px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Atul",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 100px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Ramesh",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 100px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Sivaramakrishnan",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 100px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"Sameer"         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 75px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;           } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 25px;" align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;em&gt;2-D &lt;/em&gt;array suffers from        two limitations:&lt;br /&gt;- Leads to lot of wastage of space&lt;br /&gt;- Processing of        &lt;em&gt;2-D &lt;/em&gt;array is tedious&lt;br /&gt;&lt;br /&gt;Both disadvantages can be        overcome using the array of pointers to strings. Array of pointers to        strings suffers from the disadvantage that it always needs to be        initialized, unless you decide to allocate space for each name dynamically        using &lt;i&gt;malloc( )&lt;/i&gt; and then store the address in the array of pointers        to strings.&lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;What will be the output of the following        program&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;main( )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;static        char *s[ ] = {        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"ice",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"green",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"cone",        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 150px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;"please"        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 75px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;                     } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;staic        char **ptr[ ] = { s + 3 , s + 2 , s + 1 , s } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;char        ***p = ptr ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "\n%s" , **++p ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "\n%s" , *--*++p + 3 ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "\n%s" , *p[-2] + 3 ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf (        "\n%s" , p[-1][-1] + 1 ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;Output:&lt;/i&gt;&lt;br /&gt;   cone&lt;br /&gt;          ase&lt;br /&gt;   reen&lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="color:#000000;"&gt;&lt;i&gt;Explanation:&lt;/i&gt;&lt;br /&gt;This time we        seem to be faced with a galaxy of stars! We would do well to take the help        of a figure 1. in crossing them one by one. At the outset,         &lt;em&gt;s[ ] &lt;/em&gt;has been declared and initialised as an array of pointers.        Simply saying  s  gives us the base address of this array,        4006 as can be seen from Figure 1. &lt;em&gt;ptr[ ]&lt;/em&gt;   stores the        addresses of the locations where the base addresses of strings        comprising  &lt;i&gt;s[ ]&lt;/i&gt;   have been stored, starting with the        last string. To put it more clearly,  &lt;em&gt;ptr[0] &lt;/em&gt;stores the        address 4012, which is the address at which base address of the        string "please" is stored. Similarly,  &lt;em&gt;ptr[1]&lt;/em&gt;   stores        the address 4010, which is where the base address of the string        "cone" is stored, and so on. Since &lt;em&gt;ptr[ ]&lt;/em&gt;   essentially        stores addresses of addresses, it is a pointer to a pointer, and has        been declared as such using  ** . &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="color:#000000;"&gt;Finally, the base address of         &lt;em&gt;ptr[ ]&lt;/em&gt;   is assigned to a pointer to a pointer to a        pointer,  &lt;i&gt;p&lt;/i&gt;. Reeling?! Going through the figure would        decidedly aid you to get disentangled. Thus,  p  is assigned the        address 6020.  &lt;/span&gt;&lt;/p&gt;       &lt;p align="center"&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;Figure 1.         &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Having sorted out        what is present where, we now proceed to the &lt;em&gt;printf( ) &lt;/em&gt;s. Let us        tackle the expressions one by one. &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;&lt;em&gt;**++p&lt;/em&gt;        &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;The first one        prints out the string starting from the address &lt;em&gt;**++p &lt;/em&gt;. The ++        goes to work first and increments p not to 6021, but to 6022. The C        compiler has been made to understand that on incrementing a pointer        variable, it is to point to the next location of its type. The words `of        its type' hold significance here. A pointer to a char on incrementing goes        one byte further, since a &lt;em&gt;char&lt;/em&gt; is a 1-byte entity. A pointer to        an int points 2 bytes further, as an int is a 2-byte entity. Also, a        pointer by itself is always a 2-byte entity, so incrementing a pointer to        a pointer would advance you by 2 bytes. &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Having convinced        ourselves that p now stores 6022, we go on to evaluate the expression        further&lt;em&gt;. *p&lt;/em&gt; signifies contents of 6022, i.e. 4010. &lt;em&gt;**p        &lt;/em&gt;means value at this address, i.e. value at 4010, which is the address        1010. The &lt;em&gt;printf( )&lt;/em&gt; prints the string at this address, which is        "cone". &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;*--*++p + 3        &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;&lt;em&gt;p&lt;/em&gt; ,        presently contains 6022, which on incrementing becomes 6024. Value at this        address is the address 4008, or in terms of&lt;em&gt; s , s + 1 &lt;/em&gt;. On this        the decrement operator -- works to give 4006, i.e. s . Value at 4006, or        &lt;i&gt;*( s )&lt;/i&gt; is 1000. Thus the expression is now reduced to ( 1000 + 3 ),        and what finally gets passed to &lt;em&gt;printf( )&lt;/em&gt; is the address 1003.        Value at this address is a '\0', as at the end of every string a '\0' is        inserted automatically. This '\0' is printed out as a blank by &lt;em&gt;printf(        ) .&lt;/em&gt; &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;*p[-2] + 3        &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;The current address        in &lt;i&gt;p&lt;/i&gt; is 6024. &lt;em&gt;*p[-2] &lt;/em&gt;can be thought of as &lt;em&gt;*( *( p - 2        ) )&lt;/em&gt; , as &lt;em&gt;num[i]&lt;/em&gt; is same as &lt;em&gt;*( num + i )&lt;/em&gt; . This in        turn evaluates as *( *( 6024 - 2 ) ) , i.e. *( *( 6020 ) ) , as &lt;i&gt;p&lt;/i&gt;        is a pointer to a pointer. This is equal to *( 4012 ) , as at 6020 the        address 4012 is present. Value at 4012 is 1015, i.e. the base address of        the fourth string, "please". Having reached the address of letter `p', 3        is added, which yields the address 1018. The string starting from 1018 is        printed out, which comprises of the last three letters of "please", i.e.        `ase'. &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;p[-1][-1] + 1        &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;The above        expression can be thought of as &lt;i&gt;*( p[-1] - 1 ) + 1&lt;/i&gt;, as &lt;em&gt;num[i]        &lt;/em&gt;and &lt;em&gt;*( num + i )&lt;/em&gt; amounts to the same thing. Further,        &lt;em&gt;p[-1] &lt;/em&gt;can itself be simplified to &lt;em&gt;*( p - 1 )&lt;/em&gt; . Hence we        can interpret the given expression as &lt;em&gt;*( *( p - 1 ) - 1 ) + 1 &lt;/em&gt;.        Now let us evaluate this expression. &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;After the execution        of the third printf( ) , &lt;em&gt;p&lt;/em&gt; still holds the address 6024. *( 6024        - 1 ) gives *( 6022 ) , i.e. address 4010. Therefore the expression now        becomes *( 4010 - 1 ) + 1 . Looking at the figure you would agree that        4010 can be expressed as &lt;i&gt;s + 2&lt;/i&gt; . So now the expression becomes        &lt;em&gt;*( s + 2 - 1 ) + 1 &lt;/em&gt;or &lt;em&gt;*( s + 1 ) + 1 &lt;/em&gt;. Once again the        figure would confirm that &lt;em&gt;*( s + 1 ) &lt;/em&gt;evaluates to *( 4008 ) and         *( 4008 ) yields 1004, which is the base address of the second        string "green". To this, 1 is added to yield the address of the first        element, `r'. With this as the starting address, &lt;em&gt;printf( ) &lt;/em&gt;prints        out what is remaining of the string "green". &lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;b&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;What will be the output of the following        program&lt;/span&gt;&lt;/b&gt; &lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;mai&lt;/span&gt;n( )        &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;{         &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;char        str[ ] = "For your eyes only" ;        &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;int i  ;        &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;char *p        ;        &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;for ( p        = str, i = 0 ; p + i &lt;&lt;= str + strlen ( str ) ; p++, i++  )         &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;printf (        "%c", *( p + i ) ) ;         &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt; }&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;&lt;i&gt;Output&lt;/i&gt;       &lt;br /&gt; Fryu ysol&lt;space&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;Explanation&lt;/i&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;       &lt;p align="center"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;br /&gt;Figure 2 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The for loop here hosts two        initialisations and two incrementations, which is perfectly acceptable.        However, there must always be a unique test condition. In the        initialisation part, &lt;i&gt;p&lt;/i&gt; is assigned the base address of the string,        and &lt;i&gt;i&lt;/i&gt; is set to 0. Next the condition is tested. Let us isolate        this condition for closer examination. &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;p + i &lt;&lt;= str + strlen (        str ) &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Since length of &lt;em&gt;str[ ]        &lt;/em&gt;is 18, &lt;i&gt;str + strlen ( str )&lt;/i&gt; would give the address of '\0'        present at the end of the string. If we assume that the base address of        the string is 4001, then the address of '\0' would be 4019. Since &lt;i&gt;p&lt;/i&gt;        has been assigned the base address of the string, in the first go, &lt;em&gt;p +        0&lt;/em&gt; would yield 4001. Since this is less than 4019, the condition holds        good, and the character present at the address &lt;em&gt;( p + 0 ) &lt;/em&gt;, i.e.        `F', is printed out. This can be understood better with the aid of the        Figure 2. After this, both &lt;i&gt;p&lt;/i&gt; and &lt;i&gt;i&lt;/i&gt; are incremented, so that        &lt;i&gt;p&lt;/i&gt; contains 4002 and &lt;i&gt;i&lt;/i&gt; contains 1, and once again the        condition in the for loop is tested. This time &lt;em&gt;( p + i ) &lt;/em&gt;yields        4003, whereas the expression &lt;em&gt;str + strlen ( str )&lt;/em&gt; continues to        yield 4019. Therefore again the condition is satisfied and the character        at address 4003, i.e. `r' gets printed. Likewise, alternate elements of        the string are outputted till i is 8, corresponding to which `l' is        printed. Now, when &lt;i&gt;p&lt;/i&gt; and &lt;i&gt;i&lt;/i&gt; are incremented one more time,        the test condition evaluates to:&lt;/span&gt; &lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;p + i &lt;&lt;= str + strlen (        str )&lt;br /&gt;4019 &lt;&lt;= 4019 &lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The 18&lt;sup&gt;th&lt;/sup&gt; element of        str is of course the '\0', which is also printed out as a blank. On        further incrementation of p and i , control snaps out of the for and the        program execution is terminated.  &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-849063593040284099?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/849063593040284099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=849063593040284099' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/849063593040284099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/849063593040284099'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/08/pointers-and-strings.html' title='Pointers And Strings'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-8099331213842242157</id><published>2008-08-07T03:10:00.002-07:00</published><updated>2008-12-23T03:59:24.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Pointers And Functions</title><content type='html'>&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Every type of variable with the        exception of register, has an address. we have seen how we can reference        variable of type &lt;em&gt;char&lt;/em&gt;, &lt;em&gt;int&lt;/em&gt;, &lt;em&gt;float &lt;/em&gt;etc. through        their addresses - that is by using pointers. Pointers can also point to C        functions. And why not? C functions have addresses. If we know the        function's address we can point to it, which provides another way to evoke        it. Let us see how this can be done. &lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;main( )         &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;{        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int        display( ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\nAddress of function display is %u",display ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;display(        ) ; /* usual  way of invoking a function*/        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;display( )         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\n Long live viruses!!" ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;The output of the program would        be:&lt;br /&gt;&lt;/span&gt;                      &lt;span style="font-family:Arial;font-size:85%;"&gt;Address of function display is 1125        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Long live viruses!!&lt;/span&gt;&lt;/p&gt; &lt;span style="font-family:Arial;font-size:85%;"&gt;      &lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Note that to obtain the address of a function all that we have to do is        to mention the name of the function, as has been done in &lt;em&gt;printf(        )&lt;/em&gt; statement above. This is similar to mentioning the name of the        array to get its base address.&lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Now let us see how using the address of a        function we can manage to invoke it. This is shown in the program given        below: &lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/*        Invoking function using pointer to a function */ &lt;/span&gt;&lt;/p&gt;       &lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;main( )         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int        display( ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int (        *func_ptr )( ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;func_ptr        = display ; /* assign address of function */         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\nAddress of function display is %u", func_ptr ) ;         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;(        *func_ptr )( ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;/*        invokes the function display( ) */         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;display( )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\nLong live viruses!!" ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;The output of the program would        be:&lt;br /&gt;&lt;/span&gt;                  &lt;span style="font-family:Arial;font-size:85%;"&gt;Address of function display is 1125        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Long live viruses!!         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;In &lt;em&gt;main( ) &lt;/em&gt;we declare the function &lt;em&gt;display( ) &lt;/em&gt;as a        function returning an &lt;em&gt;int&lt;/em&gt;. But what are we to make of the        declaration,        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int ( *func_ptr )(  ) ;         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;that comes in the next line? We are obviously declaring something        which, like &lt;em&gt;display( ),&lt;/em&gt; will return an int. But what is it? And        why is &lt;em&gt;*func_ptr&lt;/em&gt; enclosed in parentheses?         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;If we glance down a few lines in our program, we see the statement,          &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;func_ptr = display ;        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;So we know that &lt;i&gt;func_ptr &lt;/i&gt;is being assigned the address of        &lt;em&gt;display( ) &lt;/em&gt;. Therefore, &lt;i&gt;func_ptr &lt;/i&gt;must be a         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;pointer to the function &lt;em&gt;display( ).  &lt;/em&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Thus, all that the declaration        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int ( *func_ptr )( ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;means is, that &lt;em&gt;func_ptr&lt;/em&gt; is a pointer to a function, which        returns an &lt;i&gt;int&lt;/i&gt;. And to invoke the function we are just required to        write the statement,         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;( *func_ptr )(  ) ;&lt;/span&gt;&lt;/p&gt;       &lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;As we have seen, we can have an array of        pointers to a &lt;em&gt;int&lt;/em&gt;, &lt;em&gt;float&lt;/em&gt;, &lt;em&gt;string&lt;/em&gt; and        &lt;em&gt;structure&lt;/em&gt; similarly we can have an array of pointers to a        function. It is illustrated in following program.&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;main(  )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int ( *p        [ 3 ] ) ( int, float ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;int i  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void        fun1 ( int , float ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void        fun2 ( int , float ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void        fun3 ( int , float ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;clrscr(        ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;p [ 0 ]        = fun1  ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;p [ 1 ]        = fun2 ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;p [ 2 ]        = fun3 ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;for ( i        = 0; i &lt;= 2; i++ )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;( *p [ i        ] ) ( 10, 3.14 ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;getch( )        ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void fun1 ( int a, float b )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\na = %d  b = %f",a, b ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void fun2 ( int c, float d )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\nc = %d  d = %f",c, d ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;void fun3 ( int e, float f )        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;printf (        "\ne = %d  f = %f",e, f ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;In the above program we take an array of pointers to function &lt;em&gt;int (        *p[3] ) ( int, float )&lt;/em&gt; We store the addresses of three function        &lt;em&gt;f1( ), f2( ), f3( ) &lt;/em&gt;in array ( &lt;i&gt;int *p[ ] &lt;/i&gt;). In &lt;i&gt;for&lt;/i&gt;        loop we consecutively  call each function using their addresses        stored in array.         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;The output of the program would be:         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;i = 10  j = 3.14&lt;br /&gt;a = 10 b = 3.14&lt;br /&gt;x = 10 y =        3.14&lt;/span&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6275908374119627509-8099331213842242157?l=cprogrammings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogrammings.blogspot.com/feeds/8099331213842242157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6275908374119627509&amp;postID=8099331213842242157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/8099331213842242157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6275908374119627509/posts/default/8099331213842242157'/><link rel='alternate' type='text/html' href='http://cprogrammings.blogspot.com/2008/08/pointers-and-functions.html' title='Pointers And Functions'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6275908374119627509.post-1324922169845516321</id><published>2008-08-07T03:10:00.001-07:00</published><updated>2008-12-23T03:59:24.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Pointers And Arrays</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;An array is a collection of        similar elements stored in adjacent memory locations.&lt;br /&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int a[] = { 10, 13, -24,        -35, 67 } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;float b[] = { 1.2, 3.44,        -5.44, 6.7, 8.9 } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;long int c[25] ;         &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;If an array is defined and        initialized at the same place mentioning its &lt;em&gt;dimension&lt;/em&gt; is        optional.  &lt;/span&gt;       &lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;If similarity and        adjacency considerations are met we can build an array of anything, like        say, an array of doubles,  an array of structures, an array of        pointers etc.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;Size of an array is sum of sizes        of individual elements of an array.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Base address of an array if        address of &lt;em&gt;zeroth&lt;/em&gt; element of the array.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;Mentioning the name of the array        fetches its base address.&lt;br /&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int a[] = { 10, 13, -24,        -35, 67 } ;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;printf ( "%u %u", a,        &amp;amp;a[0] ) ; // both would give base address&lt;/span&gt;&lt;/p&gt;       &lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Array can be passed        to a function element by element. Alternatively we can pass the        entire array to a function at one shot.&lt;br /&gt;         &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;int a[] = { 10, 13, -24,        &lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;-35, 67 } ; &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int i ; &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;        &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;// passing the array element by element &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;for ( i = 0 ; i &lt;&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;display ( &lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;a[i] ) ;&lt;br /&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;// passing e&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;ntire array &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;show ( a, sizeof &lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;( a ) / 2 ) ;        &lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;To pass an entire array we simply need to pass its base        address. Whenever we pass an entire array to the function we also        need to pass the size of the array, since the function has no way to        find  out how many elements are present in the array.         &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;Array elements can be accessed        using the subscript notation or the pointer notation.        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int a[] = { 10, 13, -24,        &lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;-35, 67 } ; &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;int i ; &lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;  &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;// access using subscript notation &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;for ( i = 0 ; i &lt;&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;printf ( "%d", a[i] ) ; &lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;  &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;// accessing using pointer notation &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;for ( i = 0 ; i &lt;&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;printf ( "%d", * ( a&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt; + i ) ) ;  &lt;/span&gt;       &lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Subscript notation        is converted by the compiler into the pointer notation. Hence pointer        notation would work faster since using it we would be able to save        on  the conversion time.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;All four following expression are        same:&lt;br /&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;a[i&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;]  &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;* ( a + i ) &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;( * i + a )  &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;i[a] &lt;/span&gt;        &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;In the expression a[i]        &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Out of &lt;i&gt;a&lt;/i&gt; and &lt;i&gt;i&lt;/i&gt; one must be an integer. The other may        either be an array name or a pointer.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;An array of pointers is different        than a pointer to an array.&lt;br /&gt;        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;int *a[1&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;0] ;   &lt;/span&gt;       &lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;int ( *b )[10]&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt; ;        &lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000000;"&gt;&lt;i&gt;a&lt;/i&gt; is an array of pointers, whereas, &lt;i&gt;b&lt;/i&gt; is        pointer to an array. Incrementing &lt;i&gt;a&lt;/i&gt; using &lt;i&gt;a++&lt;/i&gt; is        illegal. On incrementing &lt;i&gt;b&lt;/i&gt; it would start pointing to        the  next location of its type.  &lt;/span&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;What would be the output of        following program&lt;br /&gt; &lt;/b&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;mai&lt;span style="color:#000000;"&gt;n(        )  &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;{  &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;int arr[ ] = { 0, 1, 2, 3, 4 } ;  &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;int *ptr ;  &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;for ( ptr = arr + 4 ; ptr &gt;&gt;= arr ; ptr--        )  &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 50px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;printf ( "%d ", arr [ ptr - arr ] ) ;  &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000000;"&gt; } &lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;i&gt;Output&lt;/i&gt; &lt;br /&gt;4 3 2 1 0         &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;i&gt;Explanation&lt;/i&gt; &lt;br /&gt;A picture is worth a        thousand words. Going by this dictum, the following figure 1 should add        clarity to your understanding  of the program.        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;br /&gt;Figure 1.   &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Now things are getting really        complicated, as the &lt;em&gt;printf( )&lt;/em&gt; would justify. Let us begin with        the &lt;i&gt;for&lt;/i&gt; loop. Firstly &lt;em&gt;ptr&lt;/em&gt; is assigned the address 6012,        the address of the &lt;em&gt;fourth&lt;/em&gt; integer from the base address. Since        this address is greater than the base address, the condition is satisfied        and the control reaches &lt;em&gt;printf( ) &lt;/em&gt;. What does &lt;em&gt;arr [ ptr - arr        ]&lt;/em&gt; evaluate to? &lt;em&gt;ptr - arr&lt;/em&gt; means 6012 - 6004 , which yields 4,        and hence &lt;em&gt;arr[4]&lt;/em&gt; prints out the &lt;em&gt;fourth&lt;/em&gt; element of the        array. Then &lt;em&gt;ptr--&lt;/em&gt; reduces &lt;em&gt;ptr&lt;/em&gt; to 6010. Since 6010 is        greater than the base address 6004, the condition is satisfied and once        again the control reaches the &lt;em&gt;printf( ) &lt;/em&gt;. This time &lt;em&gt;ptr - arr        &lt;/em&gt;becomes 6010 - 6004 , i.e. 3. Thus &lt;em&gt;arr[3] &lt;/em&gt;prints out 3. This        process is repeated till all the integers in the array have been printed        out. Possibly an easier way of understanding the expression &lt;em&gt;ptr - arr        &lt;/em&gt;would be as follows. Suppose ptr contains 6012 and arr contains 6004.        We can then view the subtraction as ( arr + 4 - arr ) , since &lt;em&gt;ptr&lt;/em&gt;        is nothing but &lt;em&gt;arr + 4 &lt;/em&gt;. Now I suppose its quite logical to        expect the result of the subtraction as 4.   &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;b&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;What would be the output of following        program&lt;/span&gt;&lt;/b&gt; &lt;span style="font-family:arial;font-size:85%;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;main&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(        )  &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt; { &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;static int a[ ] = { 0, 1, 2, 3, 4 } ; &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;static int *p[ ] = { a, a + 1, a + 2, a + 3, a + 4        }  &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;int **ptr = p  &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;printf ( "\n%u %d", a, *a )  &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;printf ( "%u %u %d", p, *p, **p )  &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0px; margin-left: 25px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;printf ( "\n%u %u %d", ptr, *ptr, **ptr ) ;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="font-family:Arial;"&gt;      &lt;/span&gt;&lt;p style="margin-bottom: 0px; margin-top: 0px;"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;"&gt;} &lt;/span&gt;         &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;i&gt;Output&lt;/i&gt;  &lt;br /&gt;6004        0 &lt;br /&gt;9016 6004 0 &lt;br /&gt;9016 6004 0  &lt;/span&gt;       &lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;i&gt;Explanation&lt;/i&gt;         &lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Look at the initialisation        of the  &lt;em&gt;p[ ] &lt;/em&gt;. During initialisation, the addresses of        various elements of the array  &lt;em&gt;a[ ]  &lt;/em&gt;are stored in the        array  &lt;em&gt;p[ ]&lt;/em&gt; . Since &lt;em&gt;p[ ] &lt;/em&gt;contains addresses of        integers, it has been declared as an array of pointers to integers. Figure        2 shows the content  &lt;em&gt;a[ ]  &lt;/em&gt;and  &lt;em&gt;p[ ] &lt;/em&gt;. In        the variable  &lt;em&gt;ptr&lt;/em&gt; , the base address of the array         &lt;em&gt;p[ ] &lt;/em&gt;, i.e. 9016 is stored. Since this address is the address        of  &lt;em&gt;p[0] &lt;/em&gt;, which itself is a pointer,         &lt;em&gt;ptr&lt;/em&gt;  has been decla
