Top "C" questions

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

gethostbyname in C

I don't know how to write applications in C, but I need a tiny program that does: lh = gethostbyname("localhost"); …

c gethostbyname
c array - warning: format not a string literal

I'm attempting to learn C and already I've run into an issue. I assume its trivial but I need to …

c compiler-warnings
Is it possible to print out only a certain section of a C-string, without making a separate substring?

Say I have the following: char* string = "Hello, how are you?"; Is it possible to print out only the last 5 …

c printf c-strings
Is the C programming language object-oriented?

I was talking with a co-worker about C and C++ and he claimed that C is object-oriented, but I claimed …

c oop standards
Should I use char** argv or char* argv[]?

I'm just learning C and was wondering which one of these I should use in my main method. Is there …

c arrays pointers standards
How to use realloc in a function in C

Building on what I learned here: Manipulating dynamic array through functions in C. void test(int data[]) { data[0] = 1; } int main(…

c arrays malloc
How to get child PID in C?

I'm creating child processes in a for-loop. Inside the child process, I can retrieve the child PID with getpid(). However, …

c fork pid
How to define and work with an array of bits in C?

I want to create a very large array on which I write '0's and '1's. I'm trying to …

c arrays multidimensional-array bit-manipulation bitarray
The tilde operator in C

I've seen the tilde operator used in the ELF hashing algorithm, and I'm curious what it does. (The code is …

c++ c operators
C - unsigned int to unsigned char array conversion

I have an unsigned int number (2 byte) and I want to convert it to unsigned char type. From my search, …

c byte unsigned-integer type-conversion unsigned-char