C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform. This tag should be used with general questions concerning the C language, as defined in the ISO 9899 standard (the latest version, 9899:2018, unless otherwise specified — also tag version-specific requests with c89, c99, c11, etc). C is distinct from C++ and it should not be combined with the C++ tag absent a rational reason.
I wrote a simple program to calculate simple interest for my CS class but it's behaving unexpectedly when I compile it in linux as shown below:
The program:
#include<stdio.h>
int main() {
//...
I wanted to try to execute 'make install' command from a makefile automatically with meson.
I tried the following in a meson.build file:
r = run_command('make install')
if r.returncode() != 0
...
The question is:
Write a program that will read an array of integers. The program should display the elements appearing at even and odd subscript position separately.
This is program from the book but ...
Before click
After Click
I'm trying to update only in Modal (Bootstrap) with the list of files I just uploaded. I am returning a partial view in Json.
The problem is that
the entire View is reloaded ...
/*
* File: ${name}.${extension}
* Author: ${user}
*
* Créé le ${date}, ${time}
*
*/
#ifndef ${GUARD_NAME}
#define ${GUARD_NAME}
// *********************************************************...
How to automate/schedule file operations(rewrite/delete whole content in file) daily at a certain system time (0000 hours / 12.00 a.m.)?
I have two functions that I use semaphore and mutex for a variant of classic the sleeping barber problem. But when I run the program, the program never ends.
Function 1: the actions of TA (barber for ...
I would like to insert value into the array's last position. So, I created the function insert. This function returns the new array.
In this code, I would like to insert value=0 into array={1}'s last ...
I've been stuck at this for a while.
Let there be an array of strings declared by user:
#define LENGTH 3
int main()
{
char* hohoho[3]={"string1","string2","string3"};
...
I've managed to get the broadcast address as a u_int32_t, and my goal is to assign the broadcast address to the saddr.sin_addr.s_addr parameter so I can turn it into a string with inet_ntoa():
struct ...
I am trying to write some code that is supposed to add kernel parameters in the file /etc/default/grub inside this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet pci=noaer resume=UUID=57661f93-9206-48ba-...
I'm trying to use libnl for a project, but I'm having issues with calls to rtnl_link_change, as it always returns a non-zero code that describes that the operation is not supported.
For example, here ...
I'm using Dev-C++ 5.11 and using compiler options to compile to C11. I'm having trouble using the scanf_s function. I've tried <stdio.h> as well as <stdlib.h>.
Is there anything in the ...
My project is a covid safety detector using a PIR sensor and an ultrasonic sensor in Arduino. This is what I do: First, when the PIR sensor detects a human(HIGH), it will send off a signal to the ...
I am trying to write a function that is given a string of text (which is to be a shell command) and now I just need to extract words, so delete spaces and save each word in a pointer to pointer to ...