Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

C23 §5.2.5.3.3 [Characteristics of floating types <float.h>] paragraph 8 says: Floating types shall be able to represent signed zeros or an unsigned zero and all normalized floating-point ...
Jan Schultke's user avatar
  • 43.6k
Tooling
0 votes
2 replies
45 views

Which IDE and tools are best suited for gcc C development? I currently use vscode and the tried using the ms-vscode.cpptools extension which "supports" gcc C. But extensions like nested ...
mcmah309's user avatar
-2 votes
0 answers
47 views

I'm developing a custom Linux kernel module for managing device resources, and I need to implement proper reference counting to prevent use-after-free (UAF) vulnerabilities. My module maintains ...
Gunjan Ghangare's user avatar
2 votes
2 answers
112 views

I recently started learning C and as a learning project I tried creating a tic tac toe bot using the Minimax algorithm. Here is the code that I have written so far: #include <stdbool.h> #include ...
floatingCatsAndDogs's user avatar
2 votes
2 answers
74 views

I'm writing some C code where I want to have a NULL-terminated GPtrArray containing static strings. Typically, I would use g_ptr_array_new_null_terminated () to construct a NULL-terminated GPtrArray, ...
Newbyte's user avatar
  • 3,957
3 votes
2 answers
132 views

typedef union { unsigned long anyvariable; float output; } map; return (*(map*)&fraction32).output; I copied this method of accessing the members of a union which ...
Cosmo Little's user avatar
Advice
0 votes
7 replies
113 views

So I've been using this code for generating such statements following This Reddit post: #define LOOP(seq) END(A seq) #define BODY(x) int x; #define A(x) BODY(x) B #define B(x) BODY(x) A #define A_END #...
Doofus's user avatar
  • 3
0 votes
1 answer
88 views

I am making an rng function in C with an upper bound. However, I'm always getting the same sequence of numbers - 3675356291. This is the file I'm using: // The #include block. Contains the header ...
pere T's user avatar
  • 11
2 votes
1 answer
178 views

My function contain a memory leak, probably related to a failing malloc situation. After extensive research and adding frees, I still can't find the edge case where the memory leak occurs. Below is ...
Simeon Sutarmin's user avatar
Advice
2 votes
7 replies
117 views

I know that it's possible to take the address of an inline function, just like with ordinary functions. But if each translation unit has its own inline definition, and I take the address of the ...
Morel's user avatar
  • 1
0 votes
0 answers
56 views

I mean that i is incremented by 1 right, then how does ptr + i equals ith block of memory since int size is 4? int i, n; printf("Enter the number of Integers: "); scanf("%d&...
0x0pralad0x0's user avatar
Best practices
1 vote
4 replies
139 views

I'm trying to have an array of structure. The sprite_s struct: typedef struct sprites_s { bool *initialized; sfSprite *duck; } sprites_t; Can I, with memset, fill the array with data so I can ...
DoctorService's user avatar
2 votes
1 answer
112 views

Take a look at my code: #include <stdio.h> #include <stdlib.h> #define add_int(a, b) ((a) + (b)) typedef struct matrix { int** data; int n_rows; int n_columns; } matrix; ...
PsquareJ Lol's user avatar
Advice
1 vote
22 replies
304 views

From the man pages, I found that size_t has the range of 0 to SIZE_MAX, and ssize_t has the range of -1 to SSIZE_MAX. So, after printing those values on a 64bit system, I have the following results: ...
sat0sh1c's user avatar
0 votes
1 answer
157 views

In my homework assignments I've got a task to get an input using scanf() of an integer number and check if its a positive negative or zero. I've coded this: #include <stdio.h> int main() { ...
CallMeEdwin's user avatar
2 votes
1 answer
178 views

The inverse of the gamma function over the reals is multivalued with an infinite number of branches. This self-answered question is about the principal inverse of the gamma function, Γ0-1(x), whose ...
njuffa's user avatar
  • 27.1k
1 vote
1 answer
55 views

I'm trying to batch some textures together in raylib (2d game) and so it tried using the 2d rlgl and for some reason that I can't figure out why nothing is getting drawn. I looked at examples and ...
ישי סירקיס's user avatar
1 vote
0 answers
69 views

I have successfully created a GTK window, made it paintable, created a WebKitWebView context, made sure it was completely transparent, and managed to render only the elements of the DOM inside the ...
beyluta's user avatar
  • 21
1 vote
1 answer
126 views

My code should print the numbers given as command line arguments. Instead it prints random-looking values. What is going on and how can I fix it? #include <stdio.h> #include <pthread.h> #...
user31884282's user avatar
-3 votes
0 answers
91 views

I'm working on an embedded (uBlaze running FreeRTOS on an FPGA) project in C, and there's a complicated network of structures, pointers, and "objects"* with complicated interdependence. Part ...
user31875001's user avatar
-2 votes
0 answers
71 views

I'm trying to use ncurses.h in C to capture the user's key press to confirm if a file should be overwritten or not, for a terminal based audio recording/playing program. The way I've implemented is I ...
Sanjay Menon's user avatar
1 vote
1 answer
42 views

I'm interested in the arguments and the return value of the function __bread_gfp, so what i did was install an entry_handler for the arguments and a handler for the return value. Here's my code: #...
Damiano De Orazi's user avatar
Advice
0 votes
2 replies
59 views

I have cygwin 3-0-0 version and wish to keep all packages under the cygwin and only upgrade 3 packages, but i am confused on what to select. I need to upgrade them for CVE fix( xz utils and gawk) I ...
aΨVaN's user avatar
  • 1,156
-5 votes
1 answer
120 views

Idk the structure to drive this. it should display like 00 01, 00 02, ... 01 99, ..., it finishs by 98 99.. just help me with the algorithm please void ft_print_comb2(void) { char a,b,c,d; a='...
Elhirah NyItokiana's user avatar
0 votes
0 answers
84 views

#include <SDL2/SDL.h> Like everyone I typed brew install sdl2 but still gives me the error --cannot open source file "SDL2/SDL.h" Is there any magical way of controlling every ...
Alpcan Alper's user avatar

1
2 3 4 5
8166