<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Technical Interview Questions &#187; C Interview Questions</title>
	<atom:link href="http://www.technicalinterview.info/category/c-interview-questions/feed" rel="self" type="application/rss+xml" />
	<link>http://www.technicalinterview.info</link>
	<description>Java Interview Questions &#124; IT interview questions &#124; Software Testing Interview questions &#124; .Net Interview Questions &#124; Job Interview Questions &#38; Answers &#124; Tough Interview Questions &#124; Technology Interview Questions &#124; Tech Interview Questions &#124; Testing Interview Questions &#124; SAP Interview Questions &#124; ABAP Interview Questions &#124; Data Warehousing Interview Questions</description>
	<pubDate>Tue, 02 Sep 2008 08:33:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>What is the difference between far and near?</title>
		<link>http://www.technicalinterview.info/what-is-the-difference-between-far-and-near/</link>
		<comments>http://www.technicalinterview.info/what-is-the-difference-between-far-and-near/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:20:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-is-the-difference-between-far-and-near.html</guid>
		<description><![CDATA[Some compilers for PC compatibles use two types of pointers.
near pointers are 16 bits long and can address a 64KB range. far pointers are 32  bits long and can address a 1MB range.
Near pointers operate within a 64KB segment. There’s one segment for function  addresses and one segment for data. far pointers have [...]]]></description>
			<content:encoded><![CDATA[<p>Some compilers for PC compatibles use two types of pointers.<br />
near pointers are 16 bits long and can address a 64KB range. far pointers are 32  bits long and can address a 1MB range.</p>
<p>Near pointers operate within a 64KB segment. There’s one segment for function  addresses and one segment for data. far pointers have a 16-bit base (the segment  address) and a 16-bit offset. The base is multiplied by 16, so a far pointer is  effectively 20 bits long. Before you compile your code, you must tell the  compiler which memory model to use. If you use a smallcode memory model, near  pointers are used by default for function addresses.</p>
<p>That means that all the functions need to fit in one 64KB segment. With a  large-code model, the default is to use far function addresses. You’ll get near  pointers with a small data model, and far pointers with a large data model.  These are just the defaults; you can declare variables and functions as  explicitly near or far.</p>
<p>far pointers are a little slower. Whenever one is used, the code or data segment  register needs to be swapped out. far pointers also have odd semantics for  arithmetic and comparison. For example, the two far pointers in the preceding  example point to the same address, but they would compare as different! If your  program fits in a small-data, small-code memory model, your life will be easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-is-the-difference-between-far-and-near/feed/</wfw:commentRss>
		</item>
		<item>
		<title>When should a far pointer be used?</title>
		<link>http://www.technicalinterview.info/when-should-a-far-pointer-be-used/</link>
		<comments>http://www.technicalinterview.info/when-should-a-far-pointer-be-used/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:19:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/when-should-a-far-pointer-be-used.html</guid>
		<description><![CDATA[Sometimes you can get away with using a small memory model in most of a given  program. There might be just a few things that don’t fit in your small data and  code segments. When that happens, you can use explicit far pointers and function  declarations to get at the rest of [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you can get away with using a small memory model in most of a given  program. There might be just a few things that don’t fit in your small data and  code segments. When that happens, you can use explicit far pointers and function  declarations to get at the rest of memory. A far function can be outside the  64KB segment most functions are shoehorned into for a small-code model. (Often,  libraries are declared explicitly far, so they’ll work no matter what code model  the program uses.)<br />
A far pointer can refer to information outside the 64KB data segment. Typically,  such pointers are used with farmalloc() and such, to manage a heap separate from  where all the rest of the data lives. If you use a small-data, large-code model,  you should explicitly make your function pointers far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/when-should-a-far-pointer-be-used/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is static memory allocation and dynamic memory allocation?</title>
		<link>http://www.technicalinterview.info/what-is-static-memory-allocation-and-dynamic-memory-allocation/</link>
		<comments>http://www.technicalinterview.info/what-is-static-memory-allocation-and-dynamic-memory-allocation/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:19:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-is-static-memory-allocation-and-dynamic-memory-allocation.html</guid>
		<description><![CDATA[ Static memory allocation:
The compiler allocates the required memory space for a  declared variable.By using the address of operator,the reserved address is  obtained and this address may be assigned to a pointer variable.Since most of  the declared variable have static memory,this way of assigning pointer value to  a pointer variable is [...]]]></description>
			<content:encoded><![CDATA[<p><strong> Static memory allocation:</strong></p>
<p>The compiler allocates the required memory space for a  declared variable.By using the address of operator,the reserved address is  obtained and this address may be assigned to a pointer variable.Since most of  the declared variable have static memory,this way of assigning pointer value to  a pointer variable is known as static memory allocation. memory is assigned  during compilation time.</p>
<p><strong> Dynamic memory allocation:</strong></p>
<p>It uses functions such as malloc( ) or calloc( ) to  get memory dynamically.If these functions are used to get memory dynamically and  the values returned by these functions are assingned to pointer variables, such  assignments are known as dynamic memory allocation.memory is assined during run  time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-is-static-memory-allocation-and-dynamic-memory-allocation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How do you determine whether to use a stream function or a low-level function?</title>
		<link>http://www.technicalinterview.info/how-do-you-determine-whether-to-use-a-stream-function-or-a-low-level-function/</link>
		<comments>http://www.technicalinterview.info/how-do-you-determine-whether-to-use-a-stream-function-or-a-low-level-function/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:18:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/how-do-you-determine-whether-to-use-a-stream-function-or-a-low-level-function.html</guid>
		<description><![CDATA[Stream functions such as fread() and fwrite() are buffered and are more  efficient when reading and writing text or binary data to files. You generally  gain better performance by using stream functions rather than their unbuffered  low-level counterparts such as read() and write().
In multi-user environments, however, when files are typically shared and [...]]]></description>
			<content:encoded><![CDATA[<p>Stream functions such as fread() and fwrite() are buffered and are more  efficient when reading and writing text or binary data to files. You generally  gain better performance by using stream functions rather than their unbuffered  low-level counterparts such as read() and write().</p>
<p>In multi-user environments, however, when files are typically shared and  portions of files are continuously being locked, read from, written to, and  unlocked, the stream functions do not perform as well as the low-level  functions. This is because it is hard to buffer a shared file whose contents are  constantly changing. Generally, you should always use buffered stream functions  when accessing nonshared files, and you should always use the low-level  functions when accessing shared files</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/how-do-you-determine-whether-to-use-a-stream-function-or-a-low-level-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is the difference between text and binary modes?</title>
		<link>http://www.technicalinterview.info/what-is-the-difference-between-text-and-binary-modes/</link>
		<comments>http://www.technicalinterview.info/what-is-the-difference-between-text-and-binary-modes/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:17:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-is-the-difference-between-text-and-binary-modes.html</guid>
		<description><![CDATA[Streams can be classified into two types: text streams and binary streams. Text  streams are interpreted, with a maximum length of 255 characters. With text  streams, carriage return/line feed combinations are translated to the newline n  character and vice versa. Binary streams are uninterpreted and are treated one  byte at a [...]]]></description>
			<content:encoded><![CDATA[<p>Streams can be classified into two types: text streams and binary streams. Text  streams are interpreted, with a maximum length of 255 characters. With text  streams, carriage return/line feed combinations are translated to the newline n  character and vice versa. Binary streams are uninterpreted and are treated one  byte at a time with no translation of characters. Typically, a text stream would  be used for reading and writing standard text files, printing output to the  screen or printer, or receiving input from the keyboard.</p>
<p>A binary text stream would typically be used for reading and writing binary  files such as graphics or word processing documents, reading mouse input, or  reading and writing to the modem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-is-the-difference-between-text-and-binary-modes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is #line used for?</title>
		<link>http://www.technicalinterview.info/what-is-line-used-for/</link>
		<comments>http://www.technicalinterview.info/what-is-line-used-for/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:17:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-is-line-used-for.html</guid>
		<description><![CDATA[The #line preprocessor directive is used to reset the values of the _ _LINE_ _  and _ _FILE_ _ symbols, respectively. This directive is commonly used in  fourth-generation languages that generate C language source files.
]]></description>
			<content:encoded><![CDATA[<p>The #line preprocessor directive is used to reset the values of the _ _LINE_ _  and _ _FILE_ _ symbols, respectively. This directive is commonly used in  fourth-generation languages that generate C language source files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-is-line-used-for/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is a pragma?</title>
		<link>http://www.technicalinterview.info/what-is-a-pragma/</link>
		<comments>http://www.technicalinterview.info/what-is-a-pragma/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:16:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-is-a-pragma.html</guid>
		<description><![CDATA[The #pragma preprocessor directive allows each compiler to implement  compiler-specific features that can be turned on and off with the #pragma  statement. For instance, your compiler might support a feature called loop  optimization. This feature can be invoked as a command-line option or as a #pragma  directive.
To implement this option using [...]]]></description>
			<content:encoded><![CDATA[<p>The #pragma preprocessor directive allows each compiler to implement  compiler-specific features that can be turned on and off with the #pragma  statement. For instance, your compiler might support a feature called loop  optimization. This feature can be invoked as a command-line option or as a #pragma  directive.</p>
<p>To implement this option using the #pragma directive, you would put the  following line into your code:</p>
<p>#pragma loop_opt(on)</p>
<p>Conversely, you can turn off loop optimization by inserting the following line  into your code:</p>
<p>#pragma loop_opt(off)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-is-a-pragma/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is a const pointer?</title>
		<link>http://www.technicalinterview.info/what-is-a-const-pointer/</link>
		<comments>http://www.technicalinterview.info/what-is-a-const-pointer/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:15:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-is-a-const-pointer.html</guid>
		<description><![CDATA[The access modifier keyword const is a promise the programmer makes to the  compiler that the value of a variable will not be changed after it is  initialized. The compiler will enforce that promise as best it can by not  enabling the programmer to write code which modifies a variable that has [...]]]></description>
			<content:encoded><![CDATA[<p>The access modifier keyword const is a promise the programmer makes to the  compiler that the value of a variable will not be changed after it is  initialized. The compiler will enforce that promise as best it can by not  enabling the programmer to write code which modifies a variable that has been  declared const.</p>
<p>A “const pointer,” or more correctly, a “pointer to const,” is a pointer which  points to data that is const (constant, or unchanging). A pointer to const is  declared by putting the word const at the beginning of the pointer declaration.  This declares a pointer which points to data that can’t be modified. The pointer  itself can be modified. The following example illustrates some legal and illegal  uses of a const pointer:</p>
<p>const char *str = “hello”;<br />
char c = *str /* legal */<br />
str++; /* legal */<br />
*str = ‘a’; /* illegal */<br />
str[1] = ‘b’; /* illegal */</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-is-a-const-pointer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What are the standard predefined macros?</title>
		<link>http://www.technicalinterview.info/what-are-the-standard-predefined-macros/</link>
		<comments>http://www.technicalinterview.info/what-are-the-standard-predefined-macros/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:15:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/what-are-the-standard-predefined-macros.html</guid>
		<description><![CDATA[The ANSI C standard defines six predefined macros for use in the C language:
Macro Name Purpose
_ _LINE_ _ Inserts the current source code line number in your code.
_ _FILE_ _ Inserts the current source code filename in your code.
_ _DATE_ _ Inserts the current date of compilation in your code.
_ _TIME_ _ Inserts the current [...]]]></description>
			<content:encoded><![CDATA[<p>The ANSI C standard defines six predefined macros for use in the C language:</p>
<p>Macro Name Purpose</p>
<p>_ _LINE_ _ Inserts the current source code line number in your code.<br />
_ _FILE_ _ Inserts the current source code filename in your code.<br />
_ _DATE_ _ Inserts the current date of compilation in your code.<br />
_ _TIME_ _ Inserts the current time of compilation in your code.<br />
_ _STDC_ _ Is set to 1 if you are enforcing strict ANSI C conformity.<br />
_ _cplusplus Is defined if you are compiling a C++ program.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/what-are-the-standard-predefined-macros/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is it better to use a macro or a function?</title>
		<link>http://www.technicalinterview.info/is-it-better-to-use-a-macro-or-a-function/</link>
		<comments>http://www.technicalinterview.info/is-it-better-to-use-a-macro-or-a-function/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 11:14:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C Interview Questions]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.technicalinterview.info/2007/is-it-better-to-use-a-macro-or-a-function.html</guid>
		<description><![CDATA[The answer depends on the situation you are writing code for. Macros have the  distinct advantage of being more efficient (and faster) than functions, because  their corresponding code is inserted directly into your source code at the point  where the macro is called. There is no overhead involved in using a macro [...]]]></description>
			<content:encoded><![CDATA[<p>The answer depends on the situation you are writing code for. Macros have the  distinct advantage of being more efficient (and faster) than functions, because  their corresponding code is inserted directly into your source code at the point  where the macro is called. There is no overhead involved in using a macro like  there is in placing a call to a function. However, macros are generally small  and cannot handle large, complex coding constructs. A function is more suited  for this type of situation. Additionally,<br />
macros are expanded inline, which means that the code is replicated for each  occurrence of a macro. Your code therefore could be somewhat larger when you use  macros than if you were to use functions.</p>
<p>Thus, the choice between using a macro and using a function is one of deciding  between the tradeoff of faster program speed versus smaller program size.  Generally, you should use macros to replace small, repeatable code sections, and  you should use functions for larger coding tasks that might require several  lines of code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicalinterview.info/is-it-better-to-use-a-macro-or-a-function/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
