Initial commit

This commit is contained in:
github-classroom[bot] 2025-02-06 06:48:42 +00:00 committed by GitHub
commit feef6058d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 5878 additions and 0 deletions

99
html/index.html Normal file
View file

@ -0,0 +1,99 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Trim String: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Trim String
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">Trim String Documentation</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Trim String - a simple string operation assignment</p>
<h1><a class="anchor" id="intoduction"></a>
Introduction</h1>
<p>A function trim() shall remove all leading and trailing whitespace characters. Whitespace characters are space (' ' ), tabulator ('\t'), new line ('<br />
'), and line feed ('\r') charaters.</p>
<p>The function should be implemented in two variants: One variant copies a part of a string into another. The other variant manipulates the original string without creating a copy.</p>
<p>If we consider the string </p><pre>" This string can be trimmed . "</pre><p> the trimmed version of it would be </p><pre>"This string can be trimmed ."</pre><h1><a class="anchor" id="assignment"></a>
Assignment</h1>
<ol type="1">
<li>Implement the non-copying variant function <code>trim()</code> such that all unit tests pass.</li>
<li>Implement the copying variant function <code>trim_cpy()</code> such that all unit tests pass.</li>
<li>Avoid code duplication, functionality that is useful for each variant shall be implemented in private(!) functions.</li>
<li>Avoid copying character by character (inefficient), use the appropriate <code>strcpy</code> function for this purpose.</li>
<li>Implement the newly created main() function such that it accpets a string as command line argument and<ol type="a">
<li>Stage 1: prints the command line arguments via printf().</li>
<li>Stage 2: copies the command line arguments via strcpy() or sprintf() or character by character (a method you did not use when implementing trim()) into a newly declared character array of length 512.</li>
<li>Stage 3: calls the function trim() and outputs the result into the <code>stdout</code>.</li>
<li>A 'usage' line shall be printed to <code>stdout</code> if the number of actual command line arguments does not match the number of expected arguments. </li>
</ol>
</li>
</ol>
</div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Mar 21 2022 19:15:25 for Trim String by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>