Category "c"

Disable Rule 2.2 checker

My shop is using Coverity 2019.3. We have MISRA-C 2004 enabled. I want to disable MISRA-C 2004 Rule 2.2: Source code shall only use /* ... */ comments. The cov-

How MQTT QoS token work in Paho MQTT C code?

I have a difficult to understand how token QoS work in Paho MQTT C code. My idea is that I want to read the PUBACK when using the QoS =1, for publisher to know

How to make CLion work with subdirectories

I'm currently a student and need to learn C. I'm working on a Debian Virtual Machine using CLion. To manage my assignments better, I created a github repository

Why doesn't my multi-process writing program trigger concurrent conflict?

I'm trying to trigger some concurrent conflicts by having several processes writing to the same file, but couldn't: #include <stdio.h> #include <stdlib

ECCODES build on Windows 11 fails on Generate step

I'm trying to build ECCODES C package (https://confluence.ecmwf.int/display/ECC/ecCodes+installation) on Windows 11 for further usage with python pygrib library

MCU crashes when "declaring" vector table in SRAM

I have a new standard c++ project on an imx rt 1024 (an nxp chip), in which I try to move my vector table to SRAM. It fails, depending on a change I apply in th

YUV420p render in OpenGL (converting to rgb in fragment shader)

I’m trying to display YUV420p video using OpenGL. I understand how it is supposed to work (uploading Y, U, and then V buffers in separate textures while p

Why I'm getting segmentation fault with python3 C-API and c FILE *

I get segmentation fault when i try to pass opened python 3 file object to c routine via FILE * pointer. I try porting a python 2 code to python 3 and as so far

Why I'm getting segmentation fault with python3 C-API and c FILE *

I get segmentation fault when i try to pass opened python 3 file object to c routine via FILE * pointer. I try porting a python 2 code to python 3 and as so far

Calling a .bat file from C program fails but if double click it works

I have this file.bat : cd "C:\Program Files(x86)\Anydesk" && anydesk.exe If i double click on it it works fine and does what i want. Now i try to launc

Move the head node from a first linked list to the back of a second linked list

When a certain if statement is passed i have to remove the head node from my first linked-list "new_queue" and add this to the back of my second linked-list "re

Cross-compiling the gettext library: error when relinking for armv7a

I'm trying to cross compile (for armv7a and aarch64, android) the gettext library (dependency for glib). The configuration and compilation is successful, but du

my copy array function didn't work. i didn't understand why

This code has to copy one array to another via void copy function. But I don't understand why it doesn't work. #include <stdio.h> void copy(int func_arra

Why is my Professor's Linked List Printing Backwards?

I have a project that I'm working on for a Systems Programming course. I'm building off of my professor's code. (Please don't mind her lack of labelling, etc. -

codeblocks output differs from online compilers

In short, I should have " 1 2 3 4 5 6 7 8 9 10 ". When executed in CodeBlocks instead of 0 i am getting random numbers. But When compiling using onli

find the nth root using binary search algorithm using C

double x; size_t n; double precision; double high = x < 1.0 ? 1.0 : x; double min = 0.0; double unknown = //idk?? double eps = 1e-6; double multiply(doub

find the nth root using binary search algorithm using C

double x; size_t n; double precision; double high = x < 1.0 ? 1.0 : x; double min = 0.0; double unknown = //idk?? double eps = 1e-6; double multiply(doub

How can i include my certificate chain and private key in a tls server using openssl library?

I am trying to write a c code to implement a tls socket using openssl. The server has a certificate chain with 4 certificates: leaf certificate - intermediate1

python package equivalent in C

I'm kind of a beginner in c, and I would like to know if there's a way of making a package like in python, for example: . ├── main.py └&

Is there a way to make a node of Linkedlist point to a node that isnt next in the list

I am making a snakes and ladders game in C using a LinkedList, I have a square struct that represents squares on the board. I need to add snakes and ladder that