Category "c"

How to print long double number in xinu?

Function sqrtl doesn't work here, also the printf of long double prints f for all given numbers: #include <conf.h> #include <kernel.h> #include <

How to fix "file too short" error once importing a C shared library with extenstion ".so"? [closed]

I am trying to run a deep learning python code written based on MASK-CNN deep network. And there is a C shared library "_crop_and_resize.so",

Error building program using gcc plugin from linux kernel source tree

I am trying to use a grsecurity gcc plugin that I found on their unofficial linux kernel source tree (the respectre_plugin/ one). My GCC version is 4.7, I modif

Does MISRA C:2012 rule 21.1 contradict with C11?

MISRA C:2012, Rule 21.1: #define and #undef shall not be used on a reserved identifier or reserved macro name. However, C11 permits to define, for example, __

GetFullPathNameA Returns Project's Path

When I tried the following code: char pathStr[MAX_PATH]; DWORD pathLen = GetFullPathNameA("notepad++.exe", MAX_PATH, pathStr, NULL); I got in "pathStr" the c

C text formatter characters count is off

So I have an assignment to format text according to rules and eventually print out the number of characters in the string (including \n and spaces, anything but

DC Motor speed and direction with PWM PSoC

I need to be able to change the direction and speed of a small dc motor using an PSoC LP5 and a L293D. The motor that was used is one of these: https://www.elec

Would the compiler optimize this for loop?

In C or C++, if the compiler encounters a for loop in which a counter is counting from 0 to n, and n is a variable (not a function call, and NOT A CONSTANT eith

How to get current directory using C language on Windows?

Can anyone tell me how to get the path of the current working directory on Windows?

Passing values to command line from a function-C language

I am trying to find out how to pass output value of a function into command line in a C file. The name of the variable is "Cext", "Cabs". The default behavior o

Hoare partition correctness

according to introduction to algorithms I wrote a code for quicksort using Hoare's partition in the codeblocks IDE .The code was successfully built but the sort

Lottie Splash screen and 'AppDelegate.m' error

I'm implementing Lottie Splash Screen on my project, I have followed all the steps on Lottie's page (https://www.npmjs.com/package/react-native-lottie-splash-sc

PostgreSQL C function to get values

I am trying to write a PostgreSQL function in C. My goal is finding minimum value of a list. So, my function will be executed like these: SELECT min_to_max(val)

When is memset to 0 nonportable? [duplicate]

From this comment in GCC bug #53119: In C, {0} is the universal zero initializer equivalent to C++'s {} (the latter being invalid in C). It i

How to stop printing comma and space after last digit in c

Here is the program I wrote: int main(void) { int d1, d2; d1 = 48; while (d1 < 58) { d2 = d1 + 1; while (d2 < 58)

ASCII value = 0 and '\0'

I have read this post. But when I tried: printf("before null %c after null\n", 0); // (ASCII=0) != '\0' ?? instead of getting: before null I got: bef

How to read into a running processus in c?

Hi how to read into a processus and how to use IMAGE_FILE_HEADER to read the pe header in this processus, thanks for replies:) sorry for my english i'm french

Finding peaks on C

Write C code to initialize an array of 10 integers. If both sides of a number are smaller than it, then that number is the peak. Once you have all the peaks, cr

Reading pattern from file and create a bmp image of that in C

I want to read an text file Using C Language.Here's the file:- You see there is some pattern in the text content on the file. 0 means nothing. 9 means blac

Callback in STM32 isn't called

Trying to make simple PWM transmitter i faced with a problem. I have TIM2 with Channel2 (in PWM Generation mode) on board NUCLEO F042K6 and USART1 connected to