Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Base 6 4 In this assignment, you will write a simple base 6 4 encoding utility to familiarize yourself with the basics of C programming.
Base
In this assignment, you will write a simple base encoding utility to familiarize yourself with the basics of C
programming. You will be using, exclusively, a small subset of the standard library to accomplish this task. You will
practice:
Parsing commandline arguments
Using the standard io library features
Handling errors
Manipulating data and working with arrays
Learning Outcomes
How to write a C program to solve a problem? Module MLO
How can programs invoke OS services using system calls? Module MLO
How do you interact with the user in C programs? Module MLO
How are programs transformed into an executable form? Module MLO
a Specification
NAME
base Base encode data and print to standard output
SYNOPSIS
base FILE
DESCRIPTION
Base encode FILE, or standard input, and output to standard output.
With no FILE, or if FILE is read from standard input.
Encoded lines are wrapped every characters.
The data are encoded according to the standard algorithm and standard base alphabet described in RFC
STDIN
The standard input shall be used only if no FILE operand is specified, or if the FILE operand is
STDOUT
The standard output shall contain the base encoded output, wrapped to characters.
STDERR
The standard error shall be used only for error reporting. All errors must be reported to standard error.
EXIT STATUS
if successful.
if an error occurs.
Additional Requirements
Your program may not use Variable Length Arrays VLAs which are declared with a nonconstant expression as
the array size eg char input n The compiler option Werrorvla will prevent compilation with VLAs.
Your program must compile against the standard, using the compiler option
In other words,
gcc stdcWerrorvla o base dots
The provided makefile compiles with the appropriate options, and you do not need to modify it
$ make release
gcc stdcWall Werrorvla Werror c o buildreleasebaseo srcbase c
gcc o buildreleasebase buildreleasebase
$ make B debug
gcc stdcWall Werrorvla obuilebuasease
gcc buil debugbase builddebugbase o
Gradescope will compile your program using its own copy of the makefile; you need only to upload your c source
files and nothing else.
Additionally, your program must run in constant space complexity while accepting input of any arbitrary length. In
other words, you may not dynamically allocate memory. The idea is that your program will process input in small
chunks, until reaching end of input. Do not attempt to buffer the entire input before encoding it If found to violate this
requirement, you will receive a
When exiting due to an error, your program must print an informative error message to the standard error stream,
stder and exit with a nonzero exit status. You are encouraged to use the convenience function err int
exitval, char const fmt exposed by the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started