Category "c"

Anaconda confuses C/C++ linker with duplicate libraries

This is happening on a Linux system. Anaconda comes with several C libraries, like libz, or libgomp. I have most of these libraries also installed globally on m

How to get the time difference between two times (24h format)

I am currently trying to create a program where the user gives two values (times, hh:mm:ss) and gets the difference between the two times. This works, if one wo

How to export matlab matrix to .txt in a format supported by c

As I state in the title, I want to export a matrix from matlab to a .txt file in format that is supported by C. What I mean is something like this { { 1, 2, 3,

configure: error: cannot run C compiled programs

I'm trying to install different software onto my Raspberry Pi with Debian Wheezy OS. When I run try to configure software I'm trying to install I get this outpu

UEFI function running wrong part in if else

I am writing a UEFI function which used to show status. But when I give it a EFI_STATUS type "2" as "state" argument, it execute "else" part, instead of "state

Why is socket linger used after socket close?

I looked at documentation about this but shouldn't a socket linger be declared before the close so the program doesn't immediately abort before it knows what ki

stm32-h743zi nucleo-144 ADC

i have a problem with getting value from ADC on the nucleo144 board. I connected a potentiometer to the pin A0, but the ADC is stuck in the HAL_PollForConversi

Libtool: link: unable to infer tagged configuration

I am trying to cross-compile linphone for ARM. I configure it using ./configure --host=arm-linux-gnueabi --with-gnu-ld --disable-static --disable-glib --with-o

tcc: error: undefined symbol '_GetConsoleWindow@0'

I'm making a program in C/C++ which must run hidden using this code: #define _WIN32_WINNT 0x0500 #include <windows.h> int main(){ HWND hWnd = GetCons

Checking whether space should be printed in the middle or at the end in for loop?

I am trying to give info to my program whether it should print space or not. My code looks something like this, and its printing spaces at the end (which is not

Lua set default error handler

The default lua_pcall error handler (as of Lua 5.3) does nothing, letting the exception message remain on top of the stack. We would like to change this so we g

SDL2 rendering with multithreading on Raspberry Pi 2

So, we're trying to build a Real-Time System with preemption within a process, executing each task as a separate thread. To build the GUI, SDL was the library c

What happens if I set a value outside of the memory allocated with calloc?

Consider the following: int* x = calloc(3,sizeof(int)); x[3] = 100; which is located inside of a function. I get no error when I compile and run the progra

Fizzbuzz program in C

Okay, this really isn't as much a fizzbuzz question as it is a C question. I wrote some simple code in C for printing out fizzbuzz as is required. #include &

How should I interpret the gstreamer multifilesink timestamp property?

I am using a multifilesink element in C. multifilesink creates file names with an index, but I need file names with a timestamp. Conveniently, multifilesink sen

how to verify a string and double in c

I'm new programming i started with c a month ago. I was writing code for my school homework and i was unable verify the gender and salary in the following code

if the data is the same add it to the array only one time

I have predefined addresses (address1,address2 and address3) and i want to : If each address variables is equal to the first 6 variables of my data then i want

Explaining "g++ not found in PATH" for an idiot

So, I just installed Eclipse for C/C++ and whenever I make a new project, I get two errors saying that the programs g++ and gcc are not in my PATH. All of the a

Why GTK4 seems to use only 48x48 icons for displaying minimized application in all context?

In GTK4 the icon system for displaying the apps have changed. In GTK3/GTK2 we could use simple commands like gtk_window_set_icon() or gtk_window_set_default_ico

Tool to compare control flow of disassembly and C

Is there a tool to compare the control flow of some disassembly and some C? Here's my situation: I started with the disassembly (x86_64) of a function. In some