Skip to content

Instantly share code, notes, and snippets.

View gotjon05's full-sized avatar

Jonathan Gottlieb gotjon05

View GitHub Profile
@gotjon05
gotjon05 / squeeze.c
Last active September 4, 2019 00:06
write an alternate version of squeeze (s1, s2) that deletes each character in s1 that matches any character in string s2
#include <stdio.h>
int main()
{
char s1[] = {"The course of true love never did run smooth"};
char s2[] = {'o', 'u', '\0'};
squeeze(s1, s2);
}
@gotjon05
gotjon05 / squeeze.c
Created August 28, 2019 04:16
write an alternate version of squeeze (s1, s2) that deletes each character in s1 that matches any character in string s2
#include <stdio.h>
void squeeze(char s1[], char s2[]);
int main()
{
char s1[] = {"The course of true love never did run smooth"};
char s2[] = {'a', 'e', 'i', 'o', 'u'};
squeeze(s1[], s2[]);
@gotjon05
gotjon05 / squeeze.c
Created August 28, 2019 04:16
write an alternate version of squeeze (s1, s2) that deletes each character in s1 that matches any character in string s2
#include <stdio.h>
void squeeze(char s1[], char s2[]);
int main()
{
char s1[] = {"The course of true love never did run smooth"};
char s2[] = {'a', 'e', 'i', 'o', 'u'};
squeeze(s1[], s2[]);
@gotjon05
gotjon05 / copied_2.3.c
Created August 26, 2019 13:54
Copied 2.3.c for understanding solution
#define YES 1
#define NO 0
#include <stdio.h>
int htoi(char s[]);
int main(){
char s[] = {'3', '0xA', 'a'};
htoi(s);
@gotjon05
gotjon05 / detab.c
Created August 9, 2019 02:34
Write a program detab that replaces tabs in the input with the proper number of blanks to space for the next tab stop
#include <stdio.h>
#define MAXLINE 1000
#define TAB 8
int getlines(char line[], int maxline);
void detab(char line[], int array_size);
@gotjon05
gotjon05 / 1.13_histogram_wordlen.c
Created August 8, 2019 22:15
write a program to print a histogram of lengths of words in its input. Draw histogram with bars horizontal and vertical.
#include <stdio.h>
#define MAXLINE 20
int getlines(char line[], int maxline);
void print_array(char line[], int maxline, int array_size);
int main()
{
int array_size;
/*
write a program to count blanks, tabs and newlines
getline function
void count_type function
*/
#define MAXLINE 1000
#include <stdio.h>
/* Write a function reverse(s) that reverses the characte string s.
Use it to write a program that reverses its input a line at a time. */
#include <stdio.h>
#define MAXLINE 1000
int getlines(char line[], int maxline);
void reverse(char s[]);
int main()