w2-1-one

w2-1-one - 198:211 Computer Architecture Week 2/Part 1 Fall...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
198:211 Computer Architecture 198:211 Computer Architecture z Topics: z Comparison of Java and C z C Programming Language Review Week 2/Part 1 Fall 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Intro to C z TAs in the recitations will go over C in detail z Other details: cereal machines, accounts etc z Compiling, debugging tools (GCC) z Learn C by programming z Don’t wait until Programming assignments are due z Start by coding, testing small C programs z Remember you already know JAVA z Learning another language is easy
Background image of page 2
Why C after Java!! z It is good to be bilingual! z More job opportunities!!! z Java is high level Programming language z C is both high level and low level z Better understanding of low-level mechanisms z Better Understand Language-architecture interface… Objective of this course z Memory-management
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Java versus C Java Program Byte Code (.class) Java Virtual Machine Hardware and Operating System javac … java … C Program Compiled Code gcc …
Background image of page 4
Java vs C Only char arrays Strings as type byte-stream I/O layered I/O model Left to programmer Automatic memory mgmt pointers No pointers Flexible (cast) strongly-typed function-oriented object-oriented C Java
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Java vs C public class hello { public static void main (String args []) { System.out.println (“Brittany Spears”); } } #include <stdio.h> int main(int argc, char *argv[]) { printf(“Brittany Spears\n”); /* \n is linefeed, \t tab */ }
Background image of page 6
Data types main( ) { int a, b, c, sum; a = 1; b = 2; c = 3; sum = a + b + c; printf("sum is %d", sum); } main( ) { int a, b; float c, sum; a = 1; b = 2; c = 3.5; sum = a + b + c; printf("sum is %f", sum); }
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Numeric data types z char z Individual characters z int z Integers z float z Real numbers z double z Real numbers with double precision z Modifiers z short, long z Control the range of numbers z signed, unsigned z for natural numbers and positive integers
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/24/2011 for the course CS 211 taught by Professor Chakraborty during the Spring '08 term at Rutgers.

Page1 / 25

w2-1-one - 198:211 Computer Architecture Week 2/Part 1 Fall...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online