Skip to main content
Filter by
Sorted by
Tagged with
1 vote
6 answers
189 views

Suppose I'm working a library; say it's in C for simplicity. This library exposes and defines two functions: f(), which calls an auxiliary function aux(), declared but not defined by my library. g() ...
einpoklum's user avatar
  • 137k
3 votes
0 answers
87 views

Can I modify host data in host_data_ptr after the following ? cudaMemcpyAsync(device_data_ptr, host_data_ptr, size, cudaMemcpyHostToDevice, ...
YSF's user avatar
  • 41
3 votes
2 answers
122 views

I am working on a small os with a custom boot loader targeting BIOS. For this, I need to map the kernel to its canonical high address space (0xFFFFFFFF80000000) and jump to its entry point. For this, ...
Holz's user avatar
  • 133
Best practices
1 vote
7 replies
161 views

So I'm making a linked list for one of my school assignments in C. I found this website that has some helpful code snippets, and I noticed that they use malloc() to allocate more memory every time ...
Klumpy7's user avatar
  • 123
0 votes
1 answer
123 views

I am trying to implement a manual implementation of strstr in eBPF but cannot get past verifier. Before starting, I know there is an existing bpf_strstr() implementation, but it's on 6.17+ linux ...
Stefan Misu's user avatar
2 votes
2 answers
149 views

I'm refreshing my C skills (been decades) and ran across something I don't quite understand. I'm working on some code that involves a lot of bit shifting, masking, etc. I have one function that ...
Maryann's user avatar
  • 39
Advice
0 votes
3 replies
89 views

I'm in C and I have an int ** (2 dimensional array, it's basically a matrix, it's actually set up a little bit complicated but there's no internal aliasing, so it's not relevant). is this int** ...
Snark's user avatar
  • 1,674
3 votes
1 answer
92 views

Consider the following MSR register (the register's value is for the sake of example): 0x0400000000000000 -> MSR[58] = 1 -> Instruction Relocation for MMU is activated. Now imagine I want to ...
manili's user avatar
  • 650
Advice
0 votes
5 replies
86 views

I've been working on a program that prints out each word, their number of occurrence's and percentage of the number occurrences over total length of the sentence. As you can imagine I had to create a ...
Mehmet emi Sevim's user avatar
2 votes
1 answer
76 views

Consider the following code snippet based on libjq. #include <stdio.h> #include <stdlib.h> #include <jq.h> #include <jv.h> int main(void) { jq_state *jq = jq_init(); ...
merlin2011's user avatar
  • 76.4k
Best practices
1 vote
7 replies
124 views

I have automated tests for fairly complex software, which send SIGQUIT signals at program startup. If the signal arrives before the handler is installed, a coredump is generated, causing the test to ...
se_pavel's user avatar
  • 2,208
0 votes
1 answer
120 views

I have a coded my simple CUDA ZIP password cracker but it seems that it prints same password for a number of times and i couldn't figure out why and this is weighing down my program. Here is the full ...
actgroup inc's user avatar
Best practices
1 vote
3 replies
98 views

I am using esp-tflite-micro to make some inferences, but it is taking too much time to finish a single inference; enough to trigger the watchdog of the idle tasks. I know I may increase the watchdog ...
Rafael Santiago Altoé's user avatar
0 votes
1 answer
91 views

I am working on a simple OpenGL ES v3.1+ setup to use it for GPGPU purposes on a headless system. (Note: Uses proprietary Mali Valhall G610 drivers on Debian 12) The GPU supports the ...
Radon's user avatar
  • 117
3 votes
2 answers
156 views

I do understand I have mistakes in this code #include <stdio.h> #include <stdlib.h> #include <string.h> int diziyi_yazdır(int dizi[], int dizi_uzunluğu) { for (int i ...
Creedance's user avatar
3 votes
3 answers
197 views

I am building a c extension for a python module and it needs to work the same on a windows machine and on a raspberry pi. #include <stdio.h> #include <string.h> #include <ctype.h> #...
KarlTheKrazyKat's user avatar
3 votes
1 answer
114 views

Suppose I have a file test.c with the content below. I as a developer have formatted my firmware blob with 8 bytes per line so that when I want to find the byte at offset 0x25 I can easily locate it. #...
Dave's user avatar
  • 935
1 vote
1 answer
51 views

I am trying to insert a list of values to a column INTEGER[]. For that I am creating list value as I need to use appender. But duckdb_create_list_value is always returning NULL. I am using v 1.4.1 C ...
rg665n's user avatar
  • 235
Advice
1 vote
9 replies
112 views

I have a binary tree which leafs have a size of 1, and the parent double in size at each level. I project those nodes on a linear axe (memory space). I need to get the equation that gives the adress ...
Simon's user avatar
  • 2,143
0 votes
0 answers
173 views

VS Code quit highlighting errors in the editor. Furthermore, autocomplete isn't working. I don't know if its a related issue, however, IntelliSense keeps getting stuck in its initialization phase. ...
Finn's user avatar
  • 35
0 votes
1 answer
92 views

I want my window to redraw the pixel put on the screen when WM_PAINT message is called after unminimizing my window. Cause all what i drawn is cleared when minimizing. I tried different thing, i think ...
ciddu42's user avatar
  • 63
2 votes
1 answer
106 views

I wrote my "Result" macro header, using C23 and some of the newest features: #pragma once #include <stdio.h> #include <stdlib.h> #define __RESULT_EAT_PARENS(...) __VA_ARGS__ ...
Karesis's user avatar
  • 23
4 votes
3 answers
167 views

The practice question I am working on reads as: Read two strings, both of them do not contain white spaces (but may contain non-alphanumeric, such as ‘,’, ‘.’, ‘/’ ...). Display the first string ...
Andrew Attfield's user avatar
-3 votes
1 answer
122 views

I'm currently working on a mini NGINX project just for learning purposes. I already implemented some logic related to socket networking. I'm now facing the problem of parsing the HTTP requests, and I ...
JUAN DIEGO DIAZ ACEVEDO's user avatar
Advice
1 vote
9 replies
200 views

unsigned int n = 1; char* s = "X" + 1; s[-n]; Is that third statement undefined in C23? It seems it is, as by the standard in 6.5.2.1.2: ... The definition of the subscript operator [] is ...
Kyle's user avatar
  • 1,116