Category "c"

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

Convert Base 16 (Hexadecimal) to Base 36 String in C

In C, what's an efficient way to convert a 64 character hexadecimal number (as a string) into a base 36 string? I mean, is it as easy as combining a few GLIB2

Question about sharing mmapped area between 2 different processes

I'm trying to share mmapped area in 2 processes. In my program, I create memory_update() process and memory_read() process. This memory_update() process update

Compiler does not support 64-bit integers on target Architechture

I am new to MPLAB XC8 compiler and don't know why this error is happening as I did not use any number that is of 64 bit in my code. Code is as follow #include &

Print the numbers 1 to 100 using 5 semaphores and processes

I have an assignment to write a program in c language that will print to the shell the numbers 1 - 100. I must use 5 processes. The first one will print 1, 6, 1

Why the use of getch() shows error?

struct node { int data; struct node *next; } *start=NULL; void create() { char ch; do { struct node *new_node,*current;

print fibo big numbers in c++ or c language

I write this code for show fibonacci series using recursion.But It not show correctly for n>43 (ex: for n=100 show:-980107325). #include<stdio.h> #in

Why is ANSI printing the code the first time the function is called and printing colours the second time around?

I am trying to change the colour output of my printf statements in a connect 4 game. I have made a function to set the print colour and reset it. It works for m

How to create a new text file in C?

I am creating a program which reads data from one text file and changes it size to upper or lower case and then stores that data in a new file. I have searched