Be Confused to Solve Confusion.


The solution shall arrive...

Of late, my newsgroup activities have increased. I am a member of comp.lang.c,
Uttara groups, and C_Spice. Following are few links to questions which I found
useful in enrichment of my knowledge. Of course, I will keep updating this page.

Note: Text version is considered as up-to-date. This page will be updated once a week.





Dennis M. Ritchie answers my Just One Question!
The reason to write him was this!



C Questions


1.

What is Bus Error? Answer 1.


2.

What is Bus Error? Answer 2.


3.

What is Bus Error? Answer 3.


4.

What is Bus Error? Answer 4.


5.

Does any one know how to convert a multi byte char to unsigned long? Answer.





6.

What is trigraph and `entry' keyword? Answer.


7.

Can we attempt to write garbage collection in C? Answer.


8.

A tip for writing conditional statements. Tip.


9.

Know about IEEE 754, floating point format. (This is not C) Answer.


10.

K&R C vs. ANSI C Answer.





11.

Know about storage of local static variables... Answer. (gcc specific)


12.

What is memory leak? Answer. (UNIX specific)


13.

I have a good tutorial on pointers written by Ted Jensen. Tutorial.


14.

How do you rate yourself in C? Answer.


15.

How to specify width and precision in printf dynamically? Answer.





16.

How to decipher a pointer declaration? Answer.


17.

Can I find the sizeof a function? Answer Answer.


18.

Why can't I increment an array like a pointer? Answer.


19.

How to distinguish parameter passing techniques? Answer .


20.

How to allocate a 2 dimensional array dynamically? Answer. Picture. (See Q. 41)





21.

Printing 1 to 100 and 100 to 1 without using loops. Answer.


22.

An analysis of a C program involving pointers. Read.


23.

Case conversion without using arithmetic op. or library functions. Program. (ASCII specific)


24.

Program to compare two structures. Program.


25.

An obfuscated C program analysis Read.





26.

About: Union. Read.


27.

About: Array access vs. Pointer access. Read.


28.

About: Cast operation. Read.


29.

About: sizeof operator and size_t Read.


30.

About: #pragma usage Read.





31.

About: Stream buffering Answer.


32.

About: Bit-fields. Read.


33.

Why multiplication of pointers is not allowed? Answer.


34.

Implementation of sizeof operator. Answer.


35.

Why this program does not work? (Pointer arithmetic) Answer.





36.

Counting the number of bits set to 1 in a float Read.


37.

Delete an arbitrary node from a singly linked-list. Solution.


38.

Reverse a singly linked-list with the given condition. Solution.


39.

Macro to find the maximum of 4 integers. Solution.


40.

Program to add/subtract two integers without using + or - . Program.





41.

How to allocate a 3 dimensional array dynamically? Answer. (See Q. 20)


42.

C code analysis (programming style). Read.






On February 6, 2004, I posted this FAQ page to comp.lang.c for reviewing. The
42 questions above were reviewed. It has got me a mixture of responses. >>




43.

Understanding: const char *p; and char * const q; Explanation.


44.

How to decipher the declaration: int(*f(char *c))(int, long*); Explanation. Thread.


45.

Dynamic linking vs. static linking. Read.





46.

A C program to print all combinations of a string. Program.


47.

How does the initialization, unsigned int i = -1;, take place?
Explanation. Explanation.


48.

There is a custom, of not casting the return value of malloc(), in clc. >>


49.

This program is not actually a FAQ, but explains new features of C Language,
such as compound literals, function inlining, etc. Read.


50.

Is the declaration: char c; same as signed char c; ? Explanation.





51.

How to detect signed integer overflow? Explanation.


52.

How can I set environmental variable(s) from my C program? Explanation.


53.

A discussion on `pointer-to-function' usage. Read.


54.

Effects of passing a range of values to malloc() and free(). Read.


55.

How do I write a macro to find the address of a structure member? Explanation.





56.

An answer to a question explaining static and register storage class and
other. Read.


57.

A program to swap corresponding msb's and lsb's of a byte. Program.


58.

A program to convert a byte into bits representation. Program.


59.

What is structure padding? Explanation.


60.

Usage of setjmp macro and longjmp() function. Explanation.





61.

About: storage of character string literals. Read.


62.

Can a C program do I/O to/from other than keyboard or file? Explanation.


63.

What is conditional compilation? Explanation.


64.

A discussion on usage of restrict type qualifier. Explanation.


65.

How do I detect the endianess of my machine? Explanation.





66.

How do I write my own portable version of islower() function. Explanation.


67.

How do I trace my C program(s)? Explanation.


68.

Is it OK to copy a structure to another using strcpy()? Explanation.


69.

Does the definition char s[500000]; invoke undefined behaviour? Explanation.





Linux Questions


1.

What is U area? Answer.


2.

Two methods of using printers... Answer. Waveform.


3.

How to access a directory exclusively? Program.


4.

About: System call invocation. Read.




Links to other sites on the Web

Download this page!
C++ Vs C
Usenet C FAQs
The C Language Calling Sequence by Dennis Ritchie
Solution(s) to K&R Exercise
Freshmeat.net

Page Count:    Counter