Skip to content

Instantly share code, notes, and snippets.

@aled1027
Created December 12, 2016 01:07
Show Gist options
  • Save aled1027/42cf9292caa19a61fbbd10283d84d094 to your computer and use it in GitHub Desktop.
Save aled1027/42cf9292caa19a61fbbd10283d84d094 to your computer and use it in GitHub Desktop.
Cole Java stuff
static int input_eg(char[] in) {
int d,f=1;
char a;
a = StdIn.readChar();
d = 0;
System.out.printf("%c mark!!!", d);
while (f==1) {
in[d] = a;
d++;
a = StdIn.readChar();
if( a=='#'){
in[d] = 13;
break;
}
}
return d; // potentially should be d+1
}
static int exit_check(char[] in) {
// strlen returns the size of the char[] in
// If in has 0 size, then return 0, indicating exit
int in_len = strlen(in);
return in_len;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment