
I. Which Statements modify a shared critical variable to indicate that another slot in the buffer is available?
J. Describe an application of a monitor- controlled circular buffer within a Operating System.


I. Which Statements modify a shared critical variable to indicate that another slot in the buffer...
write a function called readAny having the following declaration: void readAny(fstream &iofile, char buffer[], int size, int start, int index); with five parameters, iofile is the fstream variable for reading the file. Assume that the file has already been opened. buffer is the character array for returning the bytes that will be read in by the function. size specifies how many bytes to read in. start will have one of three constants 1, 2, or 3. 1 means from the...
I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME
OUT AND READ THIS. I just have to explain a lot so you understand
how the program should work.
In C programming, write a simple program to
take a text file as input and encrypt/decrypt it by reading the
text bit by bit, and swap the bits if it is specified by the first
line of the text file to do so (will explain below, and please let
me...
Programming in C: I am trying to modify this linked list to be doubly linked list. I’m also trying to add a print in reverse function. I’m really struggling with how to change the insert function to doubly link the nodes without effecting the alphabetical sorting mechanism. Example of desired output: Enter your choice: 1 to insert an element into the list. 2 to delete an element from the list. 3 to end. ? 1 Enter a character: a The...
Please read the question carefully and in full and then answer
it (using C language and any necessary libraries).
(I am not sure what the expert's mean by when to move to using
pipe. I guess if you need to, then you can use a random time or any
exact time but make sure to put a comment next to it).
you might use the below code to give you some idea:
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<string.h>
#include<sys/wait.h>
void main()...
Write a program that replace repeated three characters in a string by the character followed by 3. For example, the string aabccccaaabbbbcc would become aabc3ca3b3cc. When there are more than three repeated characters, the first three characters will be replaced by the character followed by 3. You can assume the string has only lowercase letters (a-z). Your program should include the following function: void replace(char *str, char *replaced); Your program should include the following function: void replace(char *str, char *replaced);...
GIVEN CODE. PLEASE FILL IN THE
BLANK.
// Include Block
#include <fcntl.h>
#include <unistd.h>
// Preprocessor declarations
#define BUF_SIZE 10 /* global constant buffer size: Generally this
would be much larger, but I want to show you that it works in a
loop until the entire file is read.*/
// main function
int main(int argc, char *argv[])
{
// Variable declarations
int fd;
// file descripter
char buffer[BUF_SIZE];
// string for...
Problem with C++ program. Visual Studio say when I try to debug "Run-Time Check Failure #2 - Stack around the variable 'string4b' was corrupted. I need some help because if the arrays for string4a and string4b have different sizes. Also if I put different sizes in string3a and string4b it will say that those arrays for 3a and 3b are corrupted. But for the assigment I need to put arrays of different sizes so that they can do their work...
I need help finding what is wrong with this code, it is for a CS course I am taking which codes in C (I am using XCode on Mac to code). This is the assignment: "Write a program that performs character processing on 10 characters read in from a file, and writes the results to output files. The program should read from “input.dat”. The program should write the ASCII values of the characters to “output_ascii.dat”. The program should print statistics...
Need this in C
The starter code is long, if you know how to do it in other way
please do.
Do the best you can please.
Here's
the starter code:
//
-----------------------------------------------------------------------
// monsterdb.c
//
-----------------------------------------------------------------------
#include
#include
#include
//
-----------------------------------------------------------------------
// Some defines
#define NAME_MAX 64
#define BUFFER_MAX 256
//
-----------------------------------------------------------------------
// Structs
typedef struct
{
char name[NAME_MAX];
int hp;
int attackPower;
int armor;
} Character;
typedef struct
{
int size;
Character *list;
} CharacterContainer;
//
-----------------------------------------------------------------------
//...
Step 2: Implement adder, multiplier, and degrouper -------------------------------------------------- Write the code to implement these functions. They should only consider the current expression, which is the first expression in the buffer, or, equivilently, everything up until the first semicolon. Do not implement synchronization and mutual exclusion yet. Tip: See sentinel() for an example invocation of strcpy() that shifts the characters in a string to the left. Tip: If you are not certain which stdlib functions to use for string/number manipulation, feel...