Top "C" questions

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

How to get the error message from the error code returned by GetLastError()?

After a Windows API call, how can I get the last error message in a textual form? GetLastError() returns an …

c++ c winapi
When to use malloc for char pointers

I'm specifically focused on when to use malloc on char pointers char *ptr; ptr = "something"; ...code... ...code... ptr = "something else"; …

c pointers malloc char
Does C have a "foreach" loop construct?

Almost all languages have a foreach loop or something similar. Does C have one? Can you post some example code?

c foreach
Difference between angle bracket < > and double quotes " " while including header files in C++?

Possible Duplicate: What is the difference between #include <filename> and #include “filename”? What is the difference between angle …

c++ c c++11
How to get MAC address of your machine using a C program?

I am working on Ubuntu. How can I get MAC address of my machine or an interface say eth0 using …

c linux mac-address
Linux: is there a read or recv from socket with timeout?

How can I try to read data from socket with timeout? I know, select, pselect, poll, has a timeout field, …

c linux sockets tcp
Turn a simple socket into an SSL socket

I wrote simple C programs, which are using sockets ('client' and 'server'). (UNIX/Linux usage) The server side simply creates …

c linux sockets unix ssl
Is Fortran easier to optimize than C for heavy calculations?

From time to time I read that Fortran is or can be faster then C for heavy calculations. Is that …

c performance fortran
How to read the content of a file to a string in C?

What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a …

c string file
What is the difference between prefix and postfix operators?

The following code prints a value of 9. Why? Here return(i++) will return a value of 11 and due to --i …

c postfix-operator prefix-operator