Category "c"

modifying arrays in C

backstory (if interested): Recently, I have learned to write numbers in binary. So, I wanted to see if I could write every single possibility for 32-bits. So, I

What is the most efficient way of changing Cartesian topology to one that supports MKL Cluster FFT?

I have a 3-dimensional array of size = [Nx, Ny, Nz] currently distributed among nprocs = nprocs_y * nprocs_z processes as subarrays of local_size = [Nx, Ny/npro

Why isn't an IEC 60559 conformant implementation required to define __STDC_IEC_559__ (to 1)?

The C (C99+) standard requires (though implicitly) a conforming implementation to define __STDC__ to 1. However, the C standard does not require an IEC 60559 co

Declare a queue with x-max-length programmatically using Rabbitmq-c

I am implementing a RPC function for my C application , and try to programmatically declare a queue which limits maximum number of pending messages, after read

pybind11.h: No such file or directory

I am trying to compile Deepstream 6.0 Python bindings. My guess it that the issue not related to Deepstream, but to general C/C++ compiling issues: sudo apt ins

My code runs smoothly to the end in Linux but ends abruptly in Windows

I am new to coding. As a practice problem, I wrote a program to sort strings as alphabetically, as in a dictionary. My program takes as input: (a) The number o

Trying to get 'Style' list for a GtkWidget

I'm trying hard to get a list of style properties for a GtkWidget (GtkButton). This is my code so far: #include <gtk/gtk.h> #include <stdio.h> #inc

create a binary file after sorting a numbers with names

I'm trying to wirte a C Program, which sorting list of numbers with names from txt file and write it in a bin file but the problem is that i can't write the bin

Does `offsetof(struct Derived, super.x) == offsetof(struct Base, x)` hold true in C?

I am unsure what André Caron means here: Virtual functions in C ... some of this code relies on (officially) non-standard behavior that "just happens" t

Is there a way of "extracting" communication protocol from an old software?

I have an obsolete hardware level/pressure transmitter that communicate with mcu using custom protocol (it appear to be similar to modbus RTU), that hardware co

How do i copy n characters for m lines in a file (in c)?

I have a file of 1000 lines with up to 70 characters in them. I want to copy the 13 first in a table, the 15th-30th in another table... i tried many different t

Memory management and overflow in C

I always wonder why C manages the memory the way it does. Take a look at the following codes: int main(){ int x = 10000000000; printf("%d", x); } Of co

VSCode C/C++ IntelliSense ignore patterns for includePath and browse.path

Is there a feature in VSCode IntelliSense that allows to ignore specific header files for includePath and browse.path settings? In my case I have a CMake based

Why do C compilers prepend underscores to external names?

I've been working in C for so long that the fact that compilers typically add an underscore to the start of an extern is just understood... However, another SO

Beginner to C Programming - .c file that will operate outside of console / terminal and interact with GUI?

I'm several months into learning C programming and so far have used .c files that always output to the console. Can someone suggest a sample .c file with code t

How do i convert for loop to while loop in c language?

#include<stdio.h> int main(){ int i,j,rows; printf("Input number of rows : "); scanf("%d",&rows); for (i=1;i<=rows;i++) { for (j=1;j<

CUDA Memory Allocation for AoS inside a SoA

i've been working in a program that requires to use array of structs inside another array of structs or structure of arrays, i decided to use this approach give

Why are these constructs using pre and post-increment undefined behavior?

#include <stdio.h> int main(void) { int i = 0; i = i++ + ++i; printf("%d\n", i); // 3 i = 1; i = (i++); printf("%d\n", i); // 2 Should

I want to run two functions simultaneously on AVR microcontroller. Is there any method to do so?

int main(void) { DDRC = DDRC | (1<<2); DDRC = DDRC | (1<<3); while (1) { //openSolenoidValves(100,60); //startStep

fatal error: GLFW/glfw3.h: No such file or directory

when I try to import GLFW I get an error in VSCode saying "fatal error: GLFW/glfw3.h: No such file or directory". I read some articles about this error but coul