I The C Language


II Variables and Data Storage

II.1: Where in memory are my variables stored?

II.2: Do variables need to be initialized?

II.3: What is page thrashing?

II.4: What is a const pointer?

II.5: When should the register modifier be used? Does it really help?

II.6: When should the volatile modifier be used?

II.7: Can a variable be both const and volatile ?

II.8: When should the const modifier be used?

II.9: How reliable are floating-point comparisons?

II.10: How can you determine the maximum value that a numeric variable can hold?

II.11: Are there any problems with performing mathematical operations on different variable types?

II.12: What is operator promotion?

II.13: When should a type cast be used?

II.14: When should a type cast not be used?

II.15: Is it acceptable to declare/define a variable in a C header?

II.16: What is the difference between declaring a variable and defining a variable?

II.17: Can static variables be declared in a header file?

II.18: What is the benefit of using const for declaring constants?


III Sorting and Searching Data

III.1: What is the easiest sorting method to use?

III.2: What is the quickest sorting method to use?

III.3: How can I sort things that are too large to bring into memory?

III.4: What is the easiest searching method to use?

III.5: What is the quickest searching method to use?

III.6: What is hashing?

III.7: How can I sort a linked list

III.8: How can I search for data in a linked list?

IV Data Files

IV.1: If errno contains a nonzero number, is there an error?

IV.2: What is a stream?

IV.3: How do you redirect a standard stream?

IV.4: How can you restore a redirected standard stream?

IV.5: Can stdout be forced to print somewhere other than the screen?

IV.6: What is the difference between text and binary modes?

IV.7: How do you determine whether to use a stream function or a low-level function?

IV.8: How do you list files in a directory?

IV.9: How do you list a file's date and time?

IV.10: How do you sort filenames in a directory?

IV.11: How do you determine a file's attributes?

IV.12: How do you view the PATH?

IV.13: How can I open a file so that other programs can update it at the same time?

IV.14: How can I make sure that my program is the only one accessing a file?

IV.15: How can I prevent another program from modifying part of a file that I am modifying?

IV.16: How can I have more than 20 files open at once?

IV.17: How can I avoid the Abort, Retry, Fail messages?

IV.18: How can I read and write comma-delimited text?

V Working with the Preprocessor

V.1: What is a macro, and how do you use it?

V.2: What will the preprocessor do for a program?

V.3: How can you avoid including a header more than once?

V.4: Can a file other than a .h file be included with #include ?

V.5: What is the benefit of using #define to declare a constant?

V.6: What is the benefit of using enum to declare a constant?

V.7: What is the benefit of using an enum rather than a #define constant?

V.8: How are portions of a program disabled in demo versions?

V.9: When should you use a macro rather than a function?

V.10: Is it better to use a macro or a function?

V.11: What is the best way to comment out a section of code that contains comments?

V.12: What is the difference between #include <file2> and #include "file" ?

V.13: Can you define which header file to include at compile time?

V.14: Can include files be nested?

V.15: How many levels deep can include files be nested?

V.16: What is the concatenation operator?

V.17: How can type-insensitive macros be created?

V.18: What are the standard predefined macros?

V.19: How can a program be made to print the line number where an error occurs?

V.20: How can a program be made to print the name of a source file where an error occurs?

V.21: How can you tell whether a program was compiled using C versus C++?

V.22: What is a pragma?

V.23: What is #line used for?

V.24: What is the _ _FILE_ _ preprocessor command?

V.25: How can I print the name of the source file in a program?

V.26: What is the _ _LINE_ _ preprocessor command?

V.27: How can I print the current line number of the source file in a program?

V.28: What are the _ _DATE_ _ and _ _TIME_ _ pre-processor commands?

V.29: How can I print the compile date and time in a program?

V.30: How can you be sure that a program follows the ANSI C standard?

V.31: How do you override a defined macro?

V.32: How can you check to see whether a symbol is defined?

V.33: What common macros are available?

VI Working with Strings

VI.1: What is the difference between a string copy (strcpy) and a memory copy (memcpy)?

And when should each be used?

VI.2: How can I remove the trailing spaces from a string?

VI.3: How can I remove the leading spaces from a string?

VI.4: How can I right-justify a string?

VI.5: How can I pad a string to a known length?

VI.6: How can I copy just a portion of a string?

VI.7: How can I convert a number to a string?

VI.8: How can I convert a string to a number?

VI.9: How do you print only part of a string?

VI.10: How do you remove spaces from the end of a string?

VI.11: How can you tell whether two strings are the same?

VII Pointers and Memory Allocation

VII.3: What is a null pointer?

VII.1: What is indirection?

VII.2: How many levels of pointers can you have?

VII.3: What is a null pointer?

VII.4: When is a null pointer used?

VII.5: What is a void pointer?

VII.6: When is a void pointer used?

VII.7: Can you subtract pointers from each other? Why would you?

VII.8: When you add a value to a pointer, what is really added?

VII.9: Is NULL always defined as 0?

VII.10: Is NULL always equal to 0?

VII.11: What does it mean when a pointer is used in an if statement?

VII.12: Can you add pointers together? Why would you?

VII.13: How do you use a pointer to a function?

VII.14: When would you use a pointer to a function?

VII.15: Can the size of an array be declared at runtime?

VII.16: Is it better to use malloc() or calloc()?

VII.17: How do you declare an array that will hold more than 64KB of data?

VII.18: What is the difference between far and near ?

VII.19: When should a far pointer be used?

VII.20: What is the stack?

VII.21: What is the heap?

VII.22: What happens if you free a pointer twice?

VII.23: What is the difference between NULL and NUL?

VII.24: What is a "null pointer assignment" error? What are bus errors, memory faults, and core dumps?

VII.25: How can you determine the size of an allocated portion of memory?

VII.26: How does free() know how much memory to release?

VII.27: Can math operations be performed on a void pointer?

VII.28: How do you print an address?

VIII Functions

VIII.1: When should I declare a function?

VIII.2: Why should I prototype a function?

VIII.3: How many parameters should a function have?

VIII.4: What is a static function?

VIII.5: Should a function contain a return statement if it does not return a value?

VIII.6: How can you pass an array to a function by value?

VIII.7: Is it possible to execute code even after the program exits the main() function?

VIII.8: What does a function declared as PASCAL do differently?

VIII.9: Is using exit() the same as using return?

IX Arrays

IX.1: Do array subscripts always start with zero?

IX.2: Is it valid to address one element beyond the end of an array?

IX.3: Why worry about the addresses of the elements beyond the end of an array?

IX.4: Can the sizeof operator be used to tell the size of an array passed to a function?

IX.5: Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

IX.6: Can you assign a different address to an array tag?

IX.7: What is the difference between array_name and &array_name?

IX.8: Why can't constant values be used to define an array's initial size?

IX.9: What is the difference between a string and an array?

X Bits and Bytes

X.1: What is the most efficient way to store flag values?

X.2: What is meant by "bit masking"?

X.3: Are bit fields portable?

X.4: Is it better to bitshift a value than to multiply by 2?

X.5: What is meant by high-order and low-order bytes?

X.6: How are 16- and 32-bit numbers stored?

XI Debugging

XI.1: My program hangs when I run it. What should I do?

XI.2: How can I detect memory leaks?

XI.3: What is the best way to debug my program?

What Tools Should Be Used to Debug a Program?

What Methods Can Be Used to Find Bugs in a Program?

How Can Bugs Be Avoided in the First Place?

XI.4: How can I debug a TSR program?

XI.5: How do you get a program to tell you when (and where) a condition fails?

XII Standard Library Functions

XII.1: Why should I use standard library functions instead of writing my own?

XII.2: What header files do I need in order to define the standard library functions I use?

XII.3: How can I write functions that take a variable number of arguments?

XII.4: What is the difference between a free-standing and a hostedenvironment?

XII.5: What standard functions are available to manipulate strings?

XII.6: What standard functions are available to manipulate memory?

XII.7: How do I determine whether a character is numeric, alphabetic, and so on?

XII.8: What is a "locale"?

XII.9: Is there a way to jump out of a function or functions?

XII.10: What's a signal? What do I use signals for?

XII.11: Why shouldn't I start variable names with underscores?

XII.12: Why does my compiler provide two versions of malloc()?

XII.13: What math functions are available for integers? For floating point?

XII.14: What are multibyte characters?

XII.15: How can I manipulate strings of multibyte characters?

XIII Times and Dates

XIII.1: How can I store a date in a single number? Are there any standards for this?

XIII.2: How can I store time as a single integer? Are there any standards for this?

XIII.3: Why are so many different time standards defined?

XIII.4: What is the best way to store the date?

XIII.5: What is the best way to store the time?

XIV System Calls

XIV.1: How can environment variable values be retrieved?

XIV.2: How can I call DOS functions from my program?

XIV.3: How can I call BIOS functions from my program?

XIV.4: How can I access important DOS memory locations from my program?

XIV.5: What is BIOS?

XIV.6: What are interrupts?

XIV.7: Which method is better, ANSI functions or BIOS functions?

XIV.8: Can you change to a VGA graphics mode using the BIOS?

XIV.9: Does operator precedence always work (left to right, right to left)?

XIV.10: Should a variable's type be declared within the header of a function or immediately following? Why?

XIV.11: Should programs always include a prototype for main()?

XIV.12: Should main() always return a value?

XIV.13: Can I control the mouse using the

XV Portability

XV.1: Should C++ additions to a compiler be used in a C program?

XV.2: What is the difference between C++ and C?

XV.3: Is it valid to use // for comments in a C program?

XV.4: How big is a char? A short ? An int ? A long ?

XV.5: What's the difference between big-endian and little-endian machines?

XVI ANSI/ISO Standards


 

XVI.1: Does operator precedence always work?

XVI.2: Should function arguments' types be declared in the argument list of a function or immediately following?

XVI.3: Should programs include a prototype for main()?

XVI.4: Should main() always return a value

XVII User Interface—Screen and Keyboard

XVII User Interface—Screen and Keyboard

XVII.1: Why don't I see my screen output until the program ends?

XVII.2: How do I position the cursor on the screen?

XVII.3: What is the easiest way to write data to the screen?

XVII.4: What is the fastest way to write text to the screen?

XVII.5: How can I prevent the user from breaking my program with Ctrl-Break?

XVII.6: How can you get data of only a certain type, for example, only characters?

XVII.7: Why shouldn't scanf be used to accept data?

XVII.8: How do I use function keys and arrow keys in my programs?

XVII.9: How do I prevent the user from typing too many characters in a field?

XVII.10: How do you zero-pad a number?

XVII.11: How do you print a dollars-and-cents value?

XVII.12: How do I print a number in scientific notation?

XVII.13: What is the ANSI driver?

XVII.14: How do you clear the screen with the ANSI driver?

XVII.15: How do you save the cursor's position with the ANSI driver?

XVII.16: How do you restore the cursor's position with the ANSI driver?

XVII.17: How do you change the screen color with the ANSI driver?

XVII.18: How do you write text in color with the ANSI driver?

XVII.19: How do I move the cursor with the ANSI driver?

XVIII Writing and Compiling Your Programs

XVIII.1: Should my program be written in one source file or several source files?

XVIII.2: What are the differences between the memory models?

XVIII.3: What are the most commonly used memory models?

XVIII.4: Which memory model should be used?

XVIII.5: How do you create a .COM file?

XVIII.6: What is the benefit of a .COM file over an .EXE file?

XVIII.7: Are all the functions in a library added to an .EXE file when the library is linked to the objects?

XVIII.8: Can multiple library functions be included in the same source file?

XVIII.9: Why should I create a library?

XVIII.10: My program has several files in it. How do I keep them all straight?

XVIII.11: I get the message DGROUP: group exceeds 64K during my link. What's wrong?

XVIII.12: How can I keep my program from running out of memory?

XVIII.13: My program is too big to run under DOS. How can I make it fit?

XVIII.14: How can I get more than 640KB of memory available to my DOS program?

XVIII.15: What is the difference between near and far?

XIX Programming Style and Standards

XIX.1: Should the underscore be used in variable names?

XIX.2: Can a variable's name be used to indicate its data type?

XIX.3: Does the use of comments affect program speed, executable size, or efficiency?

XIX.4: Does the use of white space affect program speed, executable size, or efficiency?

XIX.5: What is camel notation?

XIX.6: Do longer variable names affect the speed, executable size, or efficiency of a program?

XIX.7: What is the correct way to name a function?

XIX.8: What is the correct way to use braces?

XIX.9: How many letters long should variable names be? What is the ANSI standard for significance?

XIX.10: What is Hungarian notation, and should I use it?

XIX.11: What is iterative processing?

XIX.12: What is recursion, and how do you use it?

XIX.13: What is the best way to represent true and false in C?

XIX.14: What is the difference between a null loop and an infinite loop?

XIX.15: What is the difference between continue and break?

XX Miscellaneous

XX.1: How are command-line parameters obtained?

XX.2: Should programs always assume that command-line parameters can be used?

XX.3: What is the difference between "exception handling" and "structured exception handling"?

XX.4: How do you create a delay timer in a DOS program?

XX.5: Who are Kernighan and Ritchie?

XX.6: How do you create random numbers?

XX.7: When should be a 32-bit compiler is used?

XX.8: How do you interrupt a Windows program?

XX.9: Why should I use static variables?

XX.10: How can I run another program after mine?

XX.11: How can I run another program during my program's execution?

XX.12: How can I pass data from one program to another?

XX.13: How can I determine which directory my program is running from?

XX.14: How can I locate my program's important files (databases, configuration files, and such)?

XX.15: Some of your examples are not very efficient. Why did you write them so badly?

XX.16: How do you disable Ctrl-Break?

XX.17: Can you disable warm boots (Ctrl-Alt-Delete)?

XX.18: How do you tell whether a character is a letter of the alphabet?

XX.19: How do you tell whether a character is a number?

XX.20: How do you assign a hexadecimal value to a variable?

XX.21: How do you assign an octal value to a number?

XX.22: What is binary?

XX.23: What is octal?

XX.24: What is hexadecimal?

XX.25: What are escape characters?

XXI Windows

XXI.1: Can printf() be used in a Windows program?

XXI.2: How do you create a delay timer in a Windows program?

XXI.3: What is a handle?

XXI.4: How do you interrupt a Windows program?

XXI.5: What is the GDI and how is it accessed?

XXI.6: Why is windows.h important?

XXI.7: What is the Windows SDK?

XXI.8: Do you need Microsoft's Windows SDK to write Windows programs?

XXI.9: What is the difference between Windows functions and standard DOS functions?

XXI.10: What is dynamic linking?

XXI.11: What are the differences among HANDLE, HWND, and HDC ?

XXI.12: Are Windows programs compatible from one compiler to the next?

XXI.13: Will Windows always save and refresh your program's windows?

XXI.14: How do you determine a Windows program's client area size?

XXI.15: What are OEM key codes?

XXI.16: Should a Windows program care about the OEM key codes?

XXI.17: What are virtual key codes?

XXI.18: What is a dead key?

XXI.19: What is the difference between the caret and the cursor?

XXI.20: Can a mouse click be captured in an area outside your program's client area?

XXI.21: How do you create an animated bitmap?

XXI.22: How do you get the date and time in a Windows program?

XXI.23: How do you update the title bar in a Windows program?

XXI.24: How do you access the system colors in a Windows program?

XXI.25: What are the system color constants?

XXI.26: How do you create your own buttons or controls?

XXI.27: What is a static child window?

XXI.28: What is window subclassing?

XXI.29: What is the edit class?

XXI.30: What is the listbox class?

XXI.31: How is memory organized in Windows?

XXI.32: How is memory allocated in a Windows program?

XXI.33: What is the difference between modal and modeless dialog boxes?





 
Online Advertising Top Blogs Computers