Category "c"

How to use software prefetch systematically?

After reading the accepted answer in When should we use prefetch? and examples from Prefetching Examples?, I still have a lot of issues with understanding when

Pointer to a typedef in a function?

I'm completely new to C and coding in general, please be patient with me. I want to learn how to use pointers with a typedef structure inside of a function. As

I am trying to load words from a text file into a binary search tree

I am trying to load words from a text file into a binary search tree. Each line of the file contains one word. #include <stdio.h> #include <stdlib.h>

Cobol MCH3601 error when calling C program

there is a MCH3601 when calling a C program in COBOL multiple times. In the first calls, it works well, but then it fails with that error (MCH3601)... I call t

How can I get the exact output? of the print f from a array using string? c programming language

I can't get the exact output I somehow get a text in a another language something like that, #include <stdio.h> #include <stdlib.h> int main() {

Freeing the Memory of a list that contain lists

I have an assignment where i have to create a radix sort method using linked lists. First i create a sequence/list of random numbers then perform radix sort on

Building LMDB master branch on Windows

I'm trying to build LMDB from master branch, because Windows incremental file growth patch is not merged into release branch. I'm using CMake and MSVC compiler.

value always coming back as 0 when the answer should not be 0

Trying to get a value back that usually should return 20 to 30 as s with this code int s = sentences / wordcount * 100; both sentences and wordcount come out a

To compare two programs with each other

Help me understand how the program works. I take it from the book of Steven Pratt “Program language C” I find on page № 289 exercise №6.

Golden-section search in C

I'm trying to write a program that uses Golden-section search method to find the maximum area of a triangle inside an ellipse that is generated by the function

C library for gRPC

I have not found support of the C language on grpc.io. Are there any "unofficial" libraries supporting gRPC in C? My whole project is in C. I'm seeing a few opt

Writing an image to a socket in C

I made a server that can serve html to a browser, but for some reason it wont send images. Every time I send an image over the socket, the browser receives some

How can a compile a c codefile as a efi app?

I have a c code file and I would like to compile it as an efi application. How can this be done using linux and windows cli tools (i.e. without creating a visua

vector addition in OPENCL /C

I hope you are well, I have a problem with an opencl program, I execute the following program of the vector addition #define CL_USE_DEPRECATED_OPENCL_1_2APIS #i

Explanation of C++ FAQ's unsafe macro?

According to the C++ FAQ, macros are evil: [9.5] Why should I use inline functions instead of plain old #define macros? Because #define macros are ev

Explanation of C++ FAQ's unsafe macro?

According to the C++ FAQ, macros are evil: [9.5] Why should I use inline functions instead of plain old #define macros? Because #define macros are ev

Bubble sorting using function and pointers

I have this function code to bubble sort an array using pointers. However, I do not understand the second for loop (the inner one): Why did they do p < a + n

How can I fetch the length of a character array and put it in an array?

I'm working with my STM32 but since I'm new to c/c++ (coming from c#) i find string operations a bit difficult. Until now I'm sending serial like this: strcpy

How do I manipulate the contents of a stat() struct?

I have a stat struct, and I'm looking for a way to get data out of it to be manipulated. The program will successfully run and print the desired st_mtime value,

WebKitGtk doesn't load local files

I've tried loading a local html file using webkit_web_view_load_uri() with a file:// URL. However, the webview would display a blank page. To circumvent this, I