I'm looking for a way to easily embed any external binary data in a C/C++ application compiled by GCC. A good example of what I'd like to do is handling shader
I have a TCP connection. Server just reads data from the client. Now, if the connection is lost, the client will get an error while writing the data to the pipe
I'm running this code from the command prompt. The output of this code is 0 but I was expecting it to output 1. Can you explain how this code is actually compi
The "\b" didn't work on my Mac. So I tried to find the reason. I think that cause of this problem may be the version of C. Or device could be. If you know it, c
I used this code to read file. But fread function always return 0. What is my mistake? FILE *file = fopen(pathToSourceFile, "rb"); if(file!=NULL) { char a
I would like to know is it possible to do memcpy by bits instead of bytes? I am writing a C code for Ethernet frame with VLAN tagging, in which I need to fill
Is is just possible to draw a simple dotted line using SDL2 (or with gfx) like int drawDottedLine(SDL_Renderer *renderer,Sint16 x1,Sint16 y1, Sint16 x2, Sint1
I'm writing a loadable kernel module and trying to test it. After inserting it I was trying to remove it using rmmod xxx command, but I get an error saying modu
I'm trying to learn how to use SDL_TTF library. But i'm unable to solve an error of type : undefined reference to "TTF_INIT" here is the simple code that im t
I am making generated shapes in a fragment shader and part of it involves drawing the border between objects ie the dividing line between them. Currently I have
What is difference between return and exit statement in C programming when called from anywhere in a C program?
What's the best way to achieve compile time static asserts in C (not C++), with particular emphasis on GCC?
I am trying to calculate 100! (that is, the factorial of 100). I am looking for the simplest way to accomplish this using C. I have read around but have not fou
How to find the length of the longest consecutive bit string(either 1 or 0)? 00000000 11110000 00000000 00000000 -> If it is 0 then length will be 20 111
For example, in <ctype.h> there are functions like isalpha(). I want to know if writing an isalpha function on my own is faster than calling isalpha? Th
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun This is
I'm working on a project and I need to create an API. I am using sockets to communicate between the server (my application) and the clients (the other applicat
I'm working on an embedded DSP where speed is crucial, and memory is very short. At the moment, sprintf uses the most resources of any function in my code. I o
I am trying to run a simple C program but I am getting this error: warning: format ‘%s’ expects type ‘char *’, but argument 2 has ty
I'm working on an embedded DSP where speed is crucial, and memory is very short. At the moment, sprintf uses the most resources of any function in my code. I o