Top "C" questions

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

atoi() from hex representation string

Need to make int from hex representation string like "0xFA" or better "FA". Need something like atoi("FA"). Is there …

c atoi
Printing UTF-8 strings with printf - wide vs. multibyte string literals

In statements like these, where both are entered into the source code with the same encoding (UTF-8) and the locale …

c unicode utf-8 printf multibyte
Using the equality operator == to compare two strings for equality in C

int main (int argc, **argv) { if (argv[1] == "-hello") printf("True\n"); else printf("False\n"); } # ./myProg -hello False Why? I …

c string pointers equality equality-operator
UDP Socket Set Timeout

I am trying to set a 100ms timeout on a UDP Socket. I am using C. I have posted relavent …

c sockets udp
Header guards in C++ and C

At LearnCpp.com | 1.10 — A first look at the preprocessor. Under Header guards, there are those code snippets: add.h: #include "…

c++ c macros header-files include-guards
Why is the format specifier for uint8_t and uint16_t the same (%u)?

I only found pretty unrelated questions due to the tons of results searching for printf(). Why does uint8_t not …

c printf format-specifiers
Arduino (C language) parsing string with delimiter (input through serial interface)

Arduino (C language) parsing string with delimiter (input through serial interface) Didn't find the answer here :/ I want to send …

c string parsing arduino delimiter
how to bind raw socket to specific interface

My application is running on CentOS 5.5. I'm using raw socket to send data: sd = socket(AF_INET, SOCK_RAW, IPPROTO_…

c linux sockets network-programming raw-sockets
What does "#define _GNU_SOURCE" imply?

Today I had to use the basename() function, and the man 3 basename (here) gave me some strange message: Notes There …

c posix gnu
What are scanf("%*s") and scanf("%*d") format identifiers?

What is the practical use of the formats "%*" in scanf(). If this format exists, there has to be some purpose …

c formatting scanf