Top "C" questions

C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform.

Interview question: Check if one string is a rotation of other string

A friend of mine was asked the following question today at interview for the position of software developer: Given two …

java c++ c
pthread_join() and pthread_exit()

I have a question about C concurrency programming. In the pthread library, the prototype of pthread_join is int pthread_…

c multithreading concurrency pthreads
Read/write files within a Linux kernel module

I know all the discussions about why one should not read/write files from kernel, instead how to use /proc …

c file-io linux-kernel kernel-module
How can I tell gcc not to inline a function?

Say I have this small function in a source file static void foo() {} and I build an optimized version of …

c gcc inline
self referential struct definition?

I haven't been writing C for very long, and so I'm not sure about how I should go about doing …

c recursion struct typedef
Representing EOF in C code?

The newline character is represented by "\n" in C code. Is there an equivalent for the end-of-file (EOF) character?

c character ascii eof
Read from file or stdin

I am writing a utility which accepts either a filename, or reads from stdin. I would like to know the …

c file io stream stdin
What primitive data type is time_t?

I do not know the data type of time_t. Is it a float double or something else? Because if …

c types printf time-t
Checking if a file is a directory or just a file

I'm writing a program to check if something is a file or is a directory. Is there a better way …

c posix
Purpose of Unions in C and C++

I have used unions earlier comfortably; today I was alarmed when I read this post and came to know that …

c++ c unions type-punning