Category "c"

Clang compilation into sysroot with newer glibc

I'm trying to compile with a sysroot for Ubuntu 22.04 from a Ubuntu 20.04 image, and I'm having quite a bit of trouble, getting linker errors like these: /usr/b

How to exit console screen in C language

I'm trying to exit the console screen i.e close the screen what command can i use to achieve this. void main() { int n; printf("Please enter a number l

Converting an uint8_t[] to an IP address string [duplicate]

I am currently learning C. My ecosystem consists of an Espressif ESP-32 micro controller and Eclipse CDT IDE. I am trying to convert an uint

Is it possible to accelerate clang-tidy using ccache or similar?

Since employing ccache on our CI server, we find that the bottleneck in terms of build time is now our static analysis pass, that uses clang-tidy, among other t

Pipe with multiple child process

I want to create N processes from one parent and this child processes have to read that parent write, but what i have only the first process reads correctly: #

Arquivo make file para entrar em pastas [closed]

I have a MakeFile file in the following way: conf: cd teste nano teste However, when i execute make conf, he does not enter in the di

Why does calling lua_newuserdata result in SIGSEGV Segmentation Fault?

I'm trying to identify why a call to lua_newuserdata result in SIGSEGV. The gdb backtrace is : Thread 2 "main.o" received signal SIGSEGV, Segmentation fault. [S

How can I make a binary that uses openmp and compiled with intel's C compiler portable?

Normally I compile code (all in a single file main.c) with the intel oneapi command prompt like so icl.exe main.c -o binary_name I can then run binary_name.exe

Print the number 5 as a reverse pattern in C

C As you see in this code I'm trying to print the below pattern, Is the code is right to print the pattern cuz in my computer it show's wrong. //To print this t

Sum of numbers occurring in the multiplication table of 8. What's wrong with my code? Desirable output is 440, and I'm getting 33204

Sum of numbers occurring in the multiplication table of 8. What's wrong with my code? Desirable output is 440, and I'm getting 33204. #include <stdio.h>

Utilising Cython with Pyinstaller

I am trying to build a program in python using Cython and PyInstaller. Before starting, I built this test program. However, the two modules aren't working toget

Why is sleep in a child process blocking my program?

So I have this simple program that sleeps for 4 second if the value returned by fork is '0' meaning that the child process is executing, I've tried using sleep

linux socket lose data when a delay is added before read

I am learning linux socket programming, I expect that server can read data, even I add a delay but it just drops the buffer data, and receive the recent data, t

Rotating an image by x angle in c

I am rotating the image by x(45 degres) angle, But I am getting some black spots in the rotated image. How to avoid those black spots!! The logic I have used

Can I insert my code to my coded interface using Win32?

I have a C program and I am supposed to add an interface to it. Can I insert my code to my coded interface using Win32? Example: Here is my code to convert bina

Variable declaration inside curly braces

Why does the following code produce an error? I don't understand why the curly braces are making a difference. #include<stdio.h> int main(void) { {

How to add custom flag in CMake building

My main goal is to use a flag when building a project in command line. So I can add own flags like DEBUG or MY_FLAG. #ifdef DEBUG #define debug_print(format, ..

Why does webassembly use fetch before using module.malloc will cause runtimeerror?

When I open -s FETCH=1 and -s EXIT_RUNTIME=1 at the same time call emscripten_fetch after using Mudole._malloc, the following error will appear. Uncaught (in pr

Duplicate process without fork

In linux embedded system I can see in ps 2 processes of the same binary(pid1=X, pid2=Y) those processes don't have threads(/proc/X/task and /proc/Y/task don't e

Reversing a string on C language

In this program, the user is allowed to enter words of up to 20 letters, which are stored in another array and printed from the end. But there is error on my co