Category "c"

Custom date and time including nanoseconds

For this program I need to "grab the start time of the entire process within the max. time precision avail including nanoseconds." in the format: April 9, 2022

Call a function using a pointer and pass it along in the parameters

Say that I have a pointer to function theFunc. theFunc takes along a pointer that points to the address where theFunc is stored . Is this possible? Using it wou

Wrong protobuf deserialization on ARMv7

Note: I am completely new to working with different cpu architectures and working with C / gcc I am trying to create an application written in plain C, which re

C program to remove consecutive repeated characters from string

The code: https://pastebin.com/nW6A49ck /* C program to remove consecutive repeated characters from string. */ #include <stdio.h> int main() { cha

Is it possible to destroy the memory via pointer?

First I promise that I won't do anything bad with this. I'm just curious. #include <stdlib.h> #include <stdio.h> int main(int argc, char ** argv) {

Is there a way to get win32 file handle from pipe's C file descriptor (python)?

Searched for about 1 hour and still unable to find any relevant search results. I want to wait on multiple pipes in a single thread, but unable to convert the f

Adding to list and displaying list functions in C

I have my linked list that I created. I made addToStart function which has2 paramters, first parameter is the head of the list, second parameter is the data to

how to test if a variable is valid or whether it is initialized or not in C?

I am learning C from scratch with Harvard's cs50 course. I've been given an array that's been initialized this way: int stuff[9][9]; now I have to handle it. I

Error building Delegate Proxy 9.9.13 using G++ 11.2.0

I applied the 2 patches mentioned by the original author of Delegate 9.9.13 but still encountered another build error as shown below. Could someone suggest a f

Casting function pointer arguments without a helper function

void qsort(void *base, size_t nitems, size_t size, int (*compar)(const void *, const void*)) Is there a way to pass, let's say strcmp to qsort without making a

I'm not able to detect the problem while compiling [closed]

I'm writing first program in C Language but I'm unable to compile it. Please help me!

Errors when trying to use secp256k1 on Mac. 'clang: error: linker command failed with exit code 1 (use -v to see invocation)'

I'm starting learning C, but I seem to have failed in installing my first library. I'm using a Mac. I found a simple tutorial to get started: writing a program

Can extern make a function variable a global variable?

As I understood extern makes a variable --> global variable, so it means we can also make variable of another function a global variable? #include <stdio.

Writing matrix of ints to .txt

I'm trying to write a 479x639 matrix of ints to a .txt file. Preferably each line will include one entry followed by a ,, so that I can input the data on MATLAB

Weird characters appearing at the beginning of my code

I've created a code which displays integers till a given value with numbers (up to the maximum of the two digit range), and shows the tens as text. I have notic

How to read from a file and parse it

I have a file .txt containing some values formatted like this: 0,30,25,10 Now, I open up the file and store it into an array char imposta_tratt[300]; FILE *f

Can ssh accept an encrypted password?

I'm designing an app recently. For some reasons I can not use the ssh-key to connect to the remote server, so I wonder whether I could just pass an encrypted pa

simulating '<' operator in a c programme

I am recreating a complete shell. For that I must simulate <. To do this, I have to use the function dup2(). I made this but it didn't work and I donc't unde

How to fix and understand this Segmentation Fault (core dump) error? I cannot comprehend it whatsoever

I am tasked with creating a C code that does what page-replacement algorithms do. The code is barely 200 lines, so I will try to send some portions and hopefull

Platformio compilation error in bison file

I'm using bison with flex combined with Arduino framework in Platformio. Compiling .y and .l files goes without a problem, but when I'm trying to make a Build i