Category "c"

What calling convention does printf() in C use?

So I've been practicing to write simple subroutines in FASMW using the CDECL and STDCALL calling conventions and it got me wondering about what the printf funct

Returning dynamic memory inside a struct in C

Hi I have the following struct typedef struct mystruct_s { int* array; } mystruct; and I want to create a function that initializes it. I have two ways of

Trouble passing a C# string from userland to kernelmode C and using it to find specific LDR_DATA_TABLE_ENTRY

I am having difficulty comparing a string passed from usermode type LPWSTR to a LDR table entry type UNICODE_STRING Kernel C: struct { int pid; int user

What is function designator and actual call?

According to C99 Standard: The order of evaluation of the function designator, the actual arguments, and subexpressions within the actual arguments is unspe

Generic function typedef in C - how to get rid of initialization warning?

I'm experimenting with generic-like code and I have a function like this (a lot of not relevant code removed): typedef uint8_t (*struct_converter_t)(void *, cha

How to use FT_RENDER_MODE_SDF in freetype?

I'm quite new to font rendering and I'm trying to generate signed distance field with freetype so that it can be used in fragment shader in OpenGL. Here is the

Generic function typedef in C - how to get rid of initialization warning?

I'm experimenting with generic-like code and I have a function like this (a lot of not relevant code removed): typedef uint8_t (*struct_converter_t)(void *, cha

How to use FT_RENDER_MODE_SDF in freetype?

I'm quite new to font rendering and I'm trying to generate signed distance field with freetype so that it can be used in fragment shader in OpenGL. Here is the

Compilation of nginx fails due to struct 'crypt_data' has no member named 'current_salt'

I am trying to compile nginx on Ubuntu machine with GCC. My Glibc version is 2.31. m@feynman:~/Junk/nginx-1.9.9 $ /lib/x86_64-linux-gnu/libc.so.6 --version GNU

Can I change the default linker script/flags of ld?

I am using a software, which modifies some bytes in an executable. I don't know what it does exactly, but I use it for license protection of the already built b

A question about returning local pointer variable in function

I know the variables in function are using stack space. When function exit, the space are freed. That's why we should declare the pointer variable as static in

is there a way to use fgets size dynamically

So im learning about pointers and dynamic memory and how am experimenting with fgets. So i want to take in a string input into a pointer using fgets, but i want

C program How to get return value from other function by using switch statement

So I am trying to do a program where it shows a menu and asks what will the user do. I am stuck in where I cant get the return value in case 1 and use it in cas

xv6 C skipping blank lines

I am trying to write a program in C (for xv6) that returns the last "n" number of lines of input text or a file (essentially tail) with the exception that it sh

How to change c syntax check standard in vscode

vscode default c syntax checker seems that c standard used not high (maybe c99 or lower) like the example following: array ellipsis is available in c11 , actua

CS50: Filter Edge Returns Mostly White Image

I have been stuck on CS50 Filter - Edges for a few days now, having a hard time determining what's wrong with my code. This code returns an almost all white ima

How to detect if a block of memory already freed

I already know that there is no way to know if a pointer target still a valid allocation of it's already freed, so I'm trying to use pointer to pointer to solve

Save page of WebKitWebView into file

I have this almost solved. I've found this function: void webkit_web_view_save_to_file (WebKitWebView *web_view, GFile *file,

Which all multicast groups are available under custom netlink protocol

I am trying to send a notification message from a kernel module to user space application using netlink sockets interface and custom netlink protocol. My unders

How to use dynamic 2d array inside a struct array in C?

What do I want to do? I'm working on a project on dynamic matrix multiplication. I want to input from the user that on how many matrices, he/she wants to perfor