add comments bc i will forget what's going on

This commit is contained in:
NaiJi ✨ 2024-05-02 17:52:00 +04:00
parent de32013d6c
commit 536dc5aca7
17 changed files with 36 additions and 0 deletions

View File

@ -3,6 +3,8 @@
#define PRINT 0
#define SKIP 1
// printing control chars
main()
{
int c;

View File

@ -3,6 +3,10 @@
#define IN 1
#define OUT 0
// counting words from getstream,
// doesn't work with backspace
// (by design)
main()
{
int c, nl, nw, nc, state;

View File

@ -3,6 +3,8 @@
#define IN 1
#define OUT 0
// converting input string to one word per line
main()
{
int c, state, word_ending;

View File

@ -2,6 +2,8 @@
#define MAX_AMOUNT_OF_LENGTHS 256
// drawing chart of words lengths
main()
{
int c, i, j;

View File

@ -2,6 +2,8 @@
#define MAX_AMOUNT_OF_LENGTHS 256
// drawing chart of chars usage
main()
{
int c, i, j;

View File

@ -1,5 +1,7 @@
#include <stdio.h>
// creating a function to convert celsius to fahrenheit
double to_fahr(double celsius)
{
return (celsius * 9.0 / 5.0) + 32.0;

View File

@ -2,6 +2,9 @@
#define MAXLINE 10
// forcing getline to output actual amount of characters
// from input even if it exceedes MAXLINE boundary
int _getline(char line[], int maxline);
void copy(char to[], char from[]);

View File

@ -5,6 +5,8 @@
#define MAXTEXT 3000
#define SELECTION_LENGTH 10
// output all strings that are longer than MAXLINE
int _getline(char line[], int maxline);
int copy(char to[], int head, char from[]);

View File

@ -5,6 +5,8 @@
int _getline(char line[], int maxline);
void trim(char to[], char from[], int from_head);
// remove all extra spaces and tabs from tail of input
main()
{
char line[MAXLINE];

View File

@ -5,6 +5,8 @@
int _getline(char line[], int maxline);
void reverse(char to[], char from[], int from_head);
// reversing input string
main()
{
int len;

View File

@ -1,5 +1,7 @@
#include <stdio.h>
// replacing tabs with spaces so it keeps indentation
int _getline(char s[], int lim)
{
int c, i, j;

View File

@ -1,5 +1,7 @@
#include <stdio.h>
// replacing empty strings consisting of only spaces
// to tabs and spaces so it keeps initial indentation
int _getline(char s[], int lim)
{

View File

@ -1,5 +1,7 @@
#include <stdio.h>
// converting Fahrenheit to Celsius
main()
{
float fahr, celsius;

View File

@ -1,5 +1,6 @@
#include <stdio.h>
// converting celsius to fahrenheit
main()
{
float fahr, celsius;

View File

@ -1,5 +1,7 @@
#include <stdio.h>
// converting fahrenheit to celsius
main()
{
for (int fahr = 300; fahr >= 0; fahr = fahr - 20)

View File

@ -1,5 +1,7 @@
#include <stdio.h>
// counting spaces, tabs and newlines
main()
{
int c;

View File

@ -3,6 +3,8 @@
#define NORMAL 0
#define SPACEBARING 1
// trimming excessive spacebars down to one
main()
{
int c;