Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Gottlieb gotjon05

View GitHub Profile
@gotjon05
gotjon05 / squeeze.c
Last active Sep 4, 2019
write an alternate version of squeeze (s1, s2) that deletes each character in s1 that matches any character in string s2
View squeeze.c
#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 Aug 28, 2019
write an alternate version of squeeze (s1, s2) that deletes each character in s1 that matches any character in string s2
View squeeze.c
#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 Aug 28, 2019
write an alternate version of squeeze (s1, s2) that deletes each character in s1 that matches any character in string s2
View squeeze.c
#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 Aug 26, 2019
Copied 2.3.c for understanding solution
View copied_2.3.c
#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 Aug 9, 2019
Write a program detab that replaces tabs in the input with the proper number of blanks to space for the next tab stop
View detab.c
#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 Aug 8, 2019
write a program to print a histogram of lengths of words in its input. Draw histogram with bars horizontal and vertical.
View 1.13_histogram_wordlen.c
#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;
View 1.8_usingarray.c
/*
write a program to count blanks, tabs and newlines
getline function
void count_type function
*/
#define MAXLINE 1000
#include <stdio.h>
View reverse.c
/* 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()