Sponsored Links

 

 

 

CS349/SE382 A1 C Programming Tutorial

Source: www.cgl.uwaterloo.ca
Topic: C Programming


Short Desciption:
CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Dynamic Memory Dynamic Memory: Dynamic Memory Allocation I memory is allocated usingmalloc() I malloc() takes the number of ...

 

Content Inside:
CS349/SE382 A1 CProgramming Tutorial CS349/SE382 A1 CProgramming Tutorial Erin Lester January 2005 CS349/SE382 A1 CProgramming Tutorial Outline Dierences fromC++ Comments Variable Declarations Objects Dynamic Memory Boolean Type structs, enumsandunions Other Dierences The EventLoop CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Comments Comments: I Chasnoone-line comments, only block comments /*this comment is valid in C*/ /*so is this one*/ //butthisoneisnot i=2; //and neither is this one CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Variable Declarations Variable Declarations: I Variables must be declared at the beginning of code blocks, before any other types of statements #include<stdio.h> void main() { charc; inti; i=10+2; char*mystring="Hello World"; /*not allowed*/ c= ; printf("%s%c", mystring, c); } CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Objects Objects: I Chasnoobjects I use ADTs—remembercs246—to be modular CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Objects Creating a mock class/ADT Step1. Create a header file for your mock class include: I empty structure declaration I function headersw/structure as parameter CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Objects Creating a mock class/ADT Step2. Implement the code for the mock class ina.cfile: I include your.hfile I declare the structure I implement theADTsfunctions CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Dynamic Memory Dynamic Memory: Dynamic Memory Allocation I memory is allocated usingmalloc() I malloc() takes the number of bytes of memory as its parameter I it returns a (void*) pointer to the memory allocated I the pointer can then be cast to the desired type and the memory assigned toavariable CS349/SE382 A1 CProgramming Tutorial Dierences fromC++ Dynamic Memory typedefstruct{ ...

 

add to Google Reader add to Google Bookmark add to bloglines add to newsgator add to FURL add to digg add to webnews add to Netscape add to Yahoo MyWeb add to spurl.net add to diigo Bookmark newsvine Bookmark del.icio.us Bookmark @ SIMPIFY Bookmark MISTER WONG Bookmark Linkarena Bookmark icio.de Bookmark oneview Bookmark folkd.com Bookmark yigg.de Bookmark reddit Bookmark StumbleUpon Bookmark Slashdot Bookmark blinklist Bookmark technorati add to blogmarks add to blinkbits add to ma.gnolia add to smarking.com add to netvouz add to co.mments add to Connotea add to de.lirio.us

 

Related PDF Files

C Tutorial


Topic: C Programming

C Language Tutorial. Table of Contents:. 1. A First Program. 2. Let's Compute. 3. Loops. 4. Symbolic Constants. 5. Conditionals. 6. Pointers. 7. Arrays ...

A Tutorial for C/C++ Programming on Linux


Topic: C Programming

C/C++ programming on Linux and answer any queries they have. This tutorial is to help them getting started. on their own. A lot of these students also tell ...

Programming in C/C++


Topic: C Programming

... and C++ Programming in C/C++ Hits: 4,306 Description: This tutorial starts from the very beginning, and goes to the more complicated areas of the C/C++ programming. A nice tutorial, if ...

The Objective-C Programming Language


Topic: C Programming

object-oriented programming. Objective-C is defined as small but powerful set ... manual for C presented in The C Programming Language by Brian W. Kernighan ...

PicoDOS8 & ANSI C Programming Guide


Topic: C Programming

PicoDOS 8 ® Persistor Instruments Card or Disk Operating System 1 Data Acquisition and Storage Solutions for Industry and Science Instruments Inc. PER SIS TOR 254-J Shore Road, Bourne, MA, 02532 USA ...

 

Sponsored Links