Category "c"

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

How to avoid non-copyable characters in a C application, run by Eclipse

I am working with a C application, which is tested by a Java application, run in Eclipse. The Java application runs the C application, using the standard way: R

Effective software scheduling

For example in a code like below while(1){ task1(); task2(); } there should be cooperation between task1() and task2() which are executed in rr fashion. Ho

How can I disable coverity checking using code annotation?

There is a problem, coverity finds an error (potential OoB) in the place of the code where semantically this problem cannot arise. Because of the static analyze

How to correctly assign a pointer returned by dlsym into a variable of function pointer type?

I am trying to use dlopen() and dlsym() in my code and compile it with gcc. Here is the first file. /* main.c */ #include <dlfcn.h> int main() { v

How to get the strings of shstrtab?

I am writing a simplified version of Linux' readelf. I want to print section information, so I need the names of the sections. In the Elf64_Shdr struct, the sh

Is there a C function to convert a string with a number in base X to a string in base Y?

I am aware that strtol(hexstring, NULL, 16) will convert my string hexstring, which is hexadecimal, to a decimal. Likewise this would be the case in binary in s

why does have in error in undefined symbols?

I'm trying to use a 4x4_keypad.h, LCD_16x2_4bit.h and osc_config.h to get my 4x4_keypad.c, Calculator.c and LCD_16x2_4bit.c cleaner and tidied up. But I get man

What is causing "warning: assignment from incompatible pointer type error"?

I'm trying to experiment here with pointer arithmetic, but I get this warning. I am unable to understand where is this going wrong. The code is written to p

How do I properly pass command line arguments to a C program in CLion?

I need someone to outline how to pass command line arguments to CLion. What I've found so far hasn't worked for me. Specifically I need to know how to pass mult

Converting char * to Uppercase in C

I'm trying to convert a char * to uppercase in c, but the function toupper() doesn't work here. I'm trying to get the name of the the value of temp, the name be

Creating multiple threads in C

I am just a beginner in Programming using C.For my college project I want to create a multi-threaded server application to which multiple clients can connect an

Move file pointer to the end

I am trying to make a students details record program in c wherein I will store all the data in a file. I will provide the user with options such as entering a