C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform. This tag should be used with general questions concerning the C language, as defined in the ISO 9899 standard (the latest version, 9899:2018, unless otherwise specified — also tag version-specific requests with c89, c99, c11, etc). C is distinct from C++ and it should not be combined with the C++ tag absent a rational reason.
Why is there a restriction for Unicode escape sequences (\unnnn and \Unnnnnnnn) in C11 such that only those characters outside of the basic character set may be represented? For example, the following ...
I was wondering how strace was working so I looked some source code to understand a little better how it worked. Now I almost understood the whole code, I still have a question.
I would like to ...
num1 = 10;
num2 = 20;
printf("%d %d", num1, num2);
int num2 = ...
Suppose I use fopen and deem the file format to be invalid for my program or the pointer is NULL. What consequences are there to simply returning EXIT_FAILURE when I reach that situtation, without ...
I need your help for this.
I have 2 files : a.h and b.h..
typedef struct first
void foo(second_t param);
In a C Raytracing, I rotate the camera using the keys on the keyboard.
When I rotate the camera vertically (looking up or down), it follows a vertical axis but also shifts a little bit horizontally ...
I want to send mouse input programmatically to anyone of my connected displays.
I know I can use the SendInput function to do this, but my current approach doesn't work on a multi-display setup.
I am ...
I heard people say floating-point numbers arithmetic operations are very fast and I don't quite it, since for integer arithmetic operations, it can be very fast becuase the cpu only needs to do the ...
I have a big problem. My teacher told me that I must write a program. I must use reverse polish notation for operations on vectors, matrices, scalars etc. For example, when you calculate, you write
I am trying to print the size of pointers in both the cases. For both the cases I am getting 8 16 as output.
In Linux one can use
syscall(__NR_seccomp, SECCOMP_SET_MODE_STRICT, NULL, 0);
to set the calling process into a locked-down mode where
[the] only system calls that the calling thread is
I am making a game where you need to repeat the sequence of LEDs that light up. This sequence is set by two LEDs. To repeat the sequence, I use the joystick.
I had an idea to make two bool arrays ...
Notice the input string value shown
I wrote the following code:
#define MAX 50
I have two methods "log" and "measure" that should never execute at the same time.
So I tried to use a "std::mutex" to do this as follows:
void log(std::string message)
Can I use CUDA in C without rewriting code? Or in another simple way? It's different if some code is with fork, some normal and some with pthread?