Top "C" questions

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

Reading from stdin

What are the possible ways for reading user input using read() system call in Unix. How can we read from …

c unix stdin
Why is conversion from string constant to 'char*' valid in C but invalid in C++

The C++11 Standard (ISO/IEC 14882:2011) says in § C.1.1: char* p = "abc"; // valid in C, invalid in C++ For the C++ …

c++ c string c++11 char
How do you detect/avoid Memory leaks in your (Unmanaged) code?

In unmanaged C/C++ code, what are the best practices to detect memory leaks? And coding guidelines to avoid? (As …

c++ c memory-leaks
Printf long long int in C with GCC?

How do I printf long long int and also unsigned long long int in C99 using GCC? I have searched …

c gcc printf c99
What should be the sizeof(int) on a 64-bit machine?

Possible Duplicate: size of int, long, etc Does the size of an int depend on the compiler and/or processor? …

c++ c sizeof
How to use nanosleep() in C? What are `tim.tv_sec` and `tim.tv_nsec`?

What is the use of tim.tv_sec and tim.tv_nsec in the following? How can I sleep execution …

c posix sleep
memcpy() vs memmove()

I am trying to understand the difference between memcpy() and memmove(), and I have read the text that memcpy() doesn't …

c memcpy memmove
Fast ceiling of an integer division in C / C++

Given integer values x and y, C and C++ both return as the quotient q = x/y the floor of …

c++ c algorithm math
Socket accept - "Too many open files"

I am working on a school project where I had to write a multi-threaded server, and now I am comparing …

c sockets
Should I learn C before learning C++?

I visited a university CS department open day today and in the labs tour we sat down to play with …

c++ c