The following are in brief everything that you should know or at least be aware of (i.e. know to look-up) thus far in this class. Please review the following carefully and look for more information in the lessons listed above or in the tutorialspoint site or elsewhere to make sure you fully understand each subject.
man
handin
ls
cd
cp
mv
rm
mkdir
more
chmod
nano
~
handin -C assignment-name
handin -C
Use 'cd assignment-name' to change the working directory to the assignment directory and begin working.
handin --hwcheck assignment-name
handin --hwcheck
Alternatively you can use check while inside of your assignment directory. Only works for assignments that can be auto-checked.
check
handin assignment-name
Alternatively you can use submit while inside of your assignment directory.
submit
handin -g assignment-name
handin -g
-rw-r--r-- 1 user group 283 Jan 13 18:52 file │╲ ╱╲ ╱╲ ╱ │ ╲________╱ File ╲__________╱ └─── File-name │ U G O │ │ Size └──────────── Last modified time │ perms │ └────────────────────────────── User and Group owners of the file │ └──────────────────────────────────── Hard link count (ignore it) └─────────────────────────────────────────────── File type
/
.
..
char
'A'
'\0'
int
long
float
double
\'
\"
\\
\n
\r
\t
\
0-7
\0
exp == an expression that evaluates to true or false (i.e. Boolean) stmt == A statement
type var,var,...; type var=exp;
int a, b, c; int a = 52;
exp;
a++; printf("foo");
var = exp;
a=a+1; a=foo();
{ stmt1; ...}
{ foo(); bar(); }
if (exp) stmt
if (a < 10) printf("a<10");
if (exp) stmt1 else stmt2
if (a < 10) printf("a<10"); else printf("a>=10);
return-type name (variable-declarations) { stmt1; ... }
int add(int a, int b) { return a+b; }
return exp;
return 0; return a+b;
// comment
// Comment...
/* Comment */
/** * Comment */
+
a + b
-
a - b
*
a * b
a / b
%
a % b
++
++a
a++
--
--a
a--
<
a < b
<=
a <= b
>
a > b
>=
a >= b
==
a == b
!=
a != b
&&
a && b
||
a || b
!
! a
=
a = b + 1;
where 1 = true, and 0 = false.
%d
%ld
%f
%lf
%c
%s
%%
When using scanf, integer and floating point variables require an ampersand (&) prefix (e.g. &var) which informs the scanf function about the location of the variable in memory so that the value read by scanf can be placed in the variable.
&
&var
The return value for scanf should be equal to the number of things requested in the format string (i.e. the number of % format codes).