For those who would already know C and would like to know the subset of Java we're studying in this class, for those who are just learning Java and need to know C for the CS lab, and for those who are just plain interested, here is a list of how the Java we've covered in class is not valid C code.
When you declare a C function, you should not use the words ``public static'' to define it. These words are required due to Java's object-orientation features.
Comments in C begin with ``/*'' and end with ``*/''. Any newlines that might happen to be between them are ignored like the rest of the text. (Java accepts this type of comment too.)
To declare an array of thirty characters in C, you should use a different (and much simpler) syntax: type ``char a[30]''.
In Java, there is nothing wrong with returning an array. A C array declared in the form ``char a[30]'', however, should not be returned. (Returning an array in C requires pointers, which we haven't even touched on. You would have to allocate memory for it with a call to malloc(). The return type would be a pointer to a char; i.e., char*.)
To have an array parameter, you would type ``char a[]'', not ``char[] a'' as in Java.
The array length of C arrays is not available using ``a.length''. You must pass the length as another parameter.