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
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
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,
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
How can I write a condition that fulfills the same condition as inside the while clause without using a <stdbool.h> void show_path(int a[][5]) { int i =
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>
I've a tricky question and I don't know if there is any solution. Basically I've populated a struct using x-macros, for example with the following macro: #defin
int random_ticket; get_random_bytes(&random_ticket, sizeof(random_ticket)); I tried to do it like this but I think this method gives random numbers between
I've a tricky question and I don't know if there is any solution. Basically I've populated a struct using x-macros, for example with the following macro: #defin
It's all about second parameter of getline in stdio.h, I'll name it 'n' or '__linecapp' below. According to the document: If the buffer is not large enough to
MacOS CoreAudio buffer playback produces annoying noise between correct sound. I'm interested to play valid .wav data though the buffer. Why I'm playing a .wav?
In my program when a username is following another one and also has posted a "tweet" which is a string in an attempt to delete the followed username it breaks t
I'm using the C API for WordNet. When I try the following code with the word "dog", it correctly tells me that "dog" is a noun. However, if I pass "dogs", it re
Two C files have the same variable name declared differently. Can I force the compiler (Visual Studio or gcc) to prefer one declaration over the other? The scen
In C the function mktime() returns the epoch time according to the local timezone (the input struct is locally formatted). The function timegm() returns the epo
I'm trying to use pipe command and I can't understand how to. I've a lot of versions but I can't make it work. first of all the hierarchy: main prog - nicecmp -
I am trying to modify a user input string to call execvp in a future function. In my code I have a function which tokenises the user input such that if the user
I have a relay connected to GPIO26 driven by a transistor on a Raspberry Pi 4. When the logical pin is set to 0, the relay is normally closed (delivering curren
I am pretty new to coding and am working on a lexer project for school. I have made it so it can register everything as tokens and have been expanding its abili
I am trying to configure my neo 6m GPS to stop automatic sending of information. I used Hterm serial terminal to send the proprietary messages ($PUBX,40,GLL,1,0